增加进销存
This commit is contained in:
@@ -0,0 +1,180 @@
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入编号查询" v-model="queryParam.serialNo"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-dropdown>
|
||||
<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>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定设为默认吗?" @confirm="() => handleSetDefault(record.id)">
|
||||
<a>设为默认</a>
|
||||
</a-popconfirm>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" 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)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="isDefault">
|
||||
<a-tag v-if="isDefault" color="green">是</a-tag>
|
||||
<a-tag v-if="!isDefault" color="orange">否</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<account-modal ref="modalForm" @ok="modalFormOk"></account-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- BY cao_yu_li -->
|
||||
<script>
|
||||
import AccountModal from './modules/AccountModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import { postAction } from '@/api/manage'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "AccountList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
AccountModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',serialNo:'',remark:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{title: '名称', dataIndex: 'name', width: 100},
|
||||
{title: '编号', dataIndex: 'serialNo', width: 150, align: "center"},
|
||||
{title: '期初金额', dataIndex: 'initialAmount', width: 100, align: "center"},
|
||||
{title: '当前余额', dataIndex: 'currentAmount', width: 100, align: "center"},
|
||||
{ title: '是否默认',dataIndex: 'isDefault',width:100,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{title: '备注', dataIndex: 'remark', width: 100},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 150,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/account/list",
|
||||
delete: "/account/delete",
|
||||
deleteBatch: "/account/deleteBatch",
|
||||
setDefault: "/account/updateIsDefault"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleSetDefault: function (id) {
|
||||
if(!this.url.setDefault){
|
||||
this.$message.error("请设置url.delete属性!")
|
||||
return
|
||||
}
|
||||
let that = this;
|
||||
postAction(that.url.setDefault, {id: id}).then((res) => {
|
||||
if(res.code === 200){
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,194 @@
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.supplier"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入手机号码查询" v-model="queryParam.telephone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入联系电话查询" v-model="queryParam.phonenum"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-popover title="导入注意点">
|
||||
<template slot="content">
|
||||
<p><a target="_blank" href="/doc/customer_template.xls"><b>客户Excel模板下载</b></a></p>
|
||||
</template>
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-popover>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('客户信息')">导出</a-button>
|
||||
<a-dropdown>
|
||||
<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="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
|
||||
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@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>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="enabled">
|
||||
<a-tag v-if="enabled" color="green">启用</a-tag>
|
||||
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<customer-modal ref="modalForm" @ok="modalFormOk"></customer-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- BY cao_yu_li -->
|
||||
<script>
|
||||
import CustomerModal from './modules/CustomerModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { openDownloadDialog, sheet2blob} from "@/utils/util"
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "CustomerList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
CustomerModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {
|
||||
supplier:'',
|
||||
type:'客户',
|
||||
telephone:'',
|
||||
phonenum:''
|
||||
},
|
||||
ipagination:{
|
||||
pageSizeOptions: ['10', '20', '30', '100', '200']
|
||||
},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:60,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{ title: '名称',dataIndex: 'supplier',width:150},
|
||||
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
|
||||
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
|
||||
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
|
||||
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
|
||||
{ title: '期初应收',dataIndex: 'beginNeedGet',width:80,align:"center"},
|
||||
{ title: '期末应收',dataIndex: 'allNeedGet',width:80,align:"center"},
|
||||
{ title: '税率(%)', dataIndex: 'taxRate',width:80,align:"center"},
|
||||
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/supplier/list",
|
||||
delete: "/supplier/delete",
|
||||
deleteBatch: "/supplier/deleteBatch",
|
||||
importExcelUrl: "/supplier/importCustomer",
|
||||
exportXlsUrl: "/supplier/exportExcel",
|
||||
batchSetStatusUrl: "/supplier/batchSetStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchReset() {
|
||||
this.queryParam = {
|
||||
type:'客户',
|
||||
}
|
||||
this.loadData(1);
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,177 @@
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入仓库名称查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入描述查询" v-model="queryParam.remark"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-dropdown>
|
||||
<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>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定设为默认吗?" @confirm="() => handleSetDefault(record.id)">
|
||||
<a>设为默认</a>
|
||||
</a-popconfirm>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1" 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)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="isDefault">
|
||||
<a-tag v-if="isDefault" color="green">是</a-tag>
|
||||
<a-tag v-if="!isDefault" color="orange">否</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<depot-modal ref="modalForm" @ok="modalFormOk"></depot-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- BY cao_yu_li -->
|
||||
<script>
|
||||
import DepotModal from './modules/DepotModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import { postAction } from '@/api/manage'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "DepotList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
DepotModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',remark:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{title: '仓库名称', dataIndex: 'name', width: 200},
|
||||
{title: '仓库地址', dataIndex: 'address', width: 200},
|
||||
{title: '仓储费', dataIndex: 'warehousing', width: 80},
|
||||
{title: '搬运费', dataIndex: 'truckage', width: 80},
|
||||
{title: '负责人', dataIndex: 'principalName', width: 80},
|
||||
{title: '排序', dataIndex: 'sort', width: 80},
|
||||
{title: '是否默认',dataIndex: 'isDefault',width:100,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{title: '备注', dataIndex: 'remark', width: 120},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
width: 200,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/depot/list",
|
||||
delete: "/depot/delete",
|
||||
deleteBatch: "/depot/deleteBatch",
|
||||
setDefault: "/depot/updateIsDefault"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleSetDefault: function (id) {
|
||||
if(!this.url.setDefault){
|
||||
this.$message.error("请设置url.delete属性!")
|
||||
return
|
||||
}
|
||||
let that = this;
|
||||
postAction(that.url.setDefault, {id: id}).then((res) => {
|
||||
if(res.code === 200){
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,145 @@
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin-top: 5px">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-dropdown>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="enabled">
|
||||
<a-tag v-if="enabled==1" color="green">启用</a-tag>
|
||||
<a-tag v-if="enabled==0" color="orange">禁用</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<function-modal ref="modalForm" @ok="modalFormOk"></function-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<script>
|
||||
import FunctionModal from './modules/FunctionModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "FunctionList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
FunctionModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',type:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{title: '编号 ', dataIndex: 'number', width: 80},
|
||||
{title: '名称', dataIndex: 'name', width: 100},
|
||||
{title: '上级编号', dataIndex: 'parentNumber', width: 80},
|
||||
{title: '链接', dataIndex: 'url', width: 250},
|
||||
{title: '组件', dataIndex: 'component', width: 250},
|
||||
{title: '排序', dataIndex: 'sort', width: 80},
|
||||
{
|
||||
title: '是否启用', dataIndex: 'enabled', width: 80, align: "center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{title: '图标', dataIndex: 'icon', width: 110},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/function/list",
|
||||
delete: "/function/delete",
|
||||
deleteBatch: "/function/deleteBatch"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select v-model="queryParam.type" placeholder="请选择类型">
|
||||
<a-select-option value="">请选择</a-select-option>
|
||||
<a-select-option value="收入">收入</a-select-option>
|
||||
<a-select-option value="支出">支出</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-dropdown>
|
||||
<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>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@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>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="isDefault">
|
||||
<a-tag v-if="isDefault" color="green">是</a-tag>
|
||||
<a-tag v-if="!isDefault" color="orange">否</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<inOutItem-modal ref="modalForm" @ok="modalFormOk"></inOutItem-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import InOutItemModal from './modules/InOutItemModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "InOutItemList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
InOutItemModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',type:'',remark:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{title: '名称', dataIndex: 'name', width: 200},
|
||||
{title: '类型', dataIndex: 'type', width: 100},
|
||||
{title: '备注', dataIndex: 'remark', width: 200},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/inOutItem/list",
|
||||
delete: "/inOutItem/delete",
|
||||
deleteBatch: "/inOutItem/deleteBatch"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="操作模块" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入操作模块" v-model="queryParam.operation"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="操作详情" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入操作详情" v-model="queryParam.content"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-range-picker
|
||||
v-model="queryParam.createTimeRange"
|
||||
format="YYYY-MM-DD"
|
||||
:placeholder="['开始时间', '结束时间']"
|
||||
@change="onDateChange"
|
||||
@ok="onDateOk"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入操作员账号或姓名" v-model="queryParam.userInfo"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="操作IP" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入操作IP" v-model="queryParam.clientIp"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="操作状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select v-model="queryParam.status" placeholder="请选择操作状态">
|
||||
<a-select-option value="">请选择</a-select-option>
|
||||
<a-select-option value="0">成功</a-select-option>
|
||||
<a-select-option value="1">失败</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col :md="6" :sm="24" >
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<a-table
|
||||
ref="table"
|
||||
bordered
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<span slot="content" slot-scope="text, record">
|
||||
<j-ellipsis :value="text" :length="40"/>
|
||||
</span>
|
||||
</a-table>
|
||||
<!-- table区域-end -->
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from '@/components/jeecg/JEllipsis'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "LogList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
JEllipsis
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// 查询条件
|
||||
queryParam: {
|
||||
operation:'',
|
||||
content:'',
|
||||
createTimeRange:[],
|
||||
userInfo: '',
|
||||
clientIp:'',
|
||||
status:''
|
||||
},
|
||||
tabKey: "1",
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{title: '操作模块', dataIndex: 'operation', width: 120},
|
||||
{title: '操作详情', align:"left", dataIndex: 'content', scopedSlots: { customRender: 'content' }, width: 350 },
|
||||
{title: '操作员账号', dataIndex: 'loginName', width: 80, align: "center"},
|
||||
{title: '操作员姓名', dataIndex: 'userName', width: 80, align: "center"},
|
||||
{
|
||||
title: '操作状态', dataIndex: 'status',width:80, align:"center",
|
||||
customRender:function (text) {
|
||||
if(text){
|
||||
return "失败";
|
||||
}else {
|
||||
return "成功";
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '操作IP', dataIndex: 'clientIp', width: 110, align: "center"},
|
||||
{title: '操作时间', dataIndex: 'createTimeStr', width: 120, align: "center"}
|
||||
],
|
||||
operateColumn:
|
||||
{
|
||||
title: '操作类型',
|
||||
dataIndex: 'operateType_dictText',
|
||||
align:"center",
|
||||
},
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
url: {
|
||||
list: "/log/list",
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 日志类型
|
||||
callback(key){
|
||||
// 动态添加操作类型列
|
||||
if (key == 2) {
|
||||
this.tabKey = '2';
|
||||
this.columns.splice(7, 0, this.operateColumn);
|
||||
}else if(this.columns.length == 9)
|
||||
{
|
||||
this.tabKey = '1';
|
||||
this.columns.splice(7,1);
|
||||
}
|
||||
|
||||
let that=this;
|
||||
that.queryParam.logType=key;
|
||||
that.loadData();
|
||||
},
|
||||
onDateChange: function (value, dateString) {
|
||||
console.log(dateString[0],dateString[1]);
|
||||
this.queryParam.beginTime=dateString[0];
|
||||
this.queryParam.endTime=dateString[1];
|
||||
},
|
||||
onDateOk(value) {
|
||||
console.log(value);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.supplier"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入手机号码查询" v-model="queryParam.telephone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入联系电话查询" v-model="queryParam.phonenum"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-popover title="导入注意点">
|
||||
<template slot="content">
|
||||
<p><a target="_blank" href="/doc/member_template.xls"><b>会员Excel模板下载</b></a></p>
|
||||
</template>
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-popover>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('会员信息')">导出</a-button>
|
||||
<a-dropdown>
|
||||
<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="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
|
||||
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="enabled">
|
||||
<a-tag v-if="enabled" color="green">启用</a-tag>
|
||||
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<member-modal ref="modalForm" @ok="modalFormOk"></member-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import MemberModal from './modules/MemberModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { openDownloadDialog, sheet2blob} from "@/utils/util"
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
export default {
|
||||
name: "MemberList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
MemberModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {
|
||||
supplier:'',
|
||||
type:'会员',
|
||||
telephone:'',
|
||||
phonenum:''
|
||||
},
|
||||
ipagination:{
|
||||
pageSizeOptions: ['10', '20', '30', '100', '200']
|
||||
},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:60,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{ title: '名称',dataIndex: 'supplier',width:150},
|
||||
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
|
||||
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
|
||||
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
|
||||
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
|
||||
{ title: '预付款',dataIndex: 'advanceIn',width:70,align:"center"},
|
||||
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/supplier/list",
|
||||
delete: "/supplier/delete",
|
||||
deleteBatch: "/supplier/deleteBatch",
|
||||
importExcelUrl: "/supplier/importMember",
|
||||
exportXlsUrl: "/supplier/exportExcel",
|
||||
batchSetStatusUrl: "/supplier/batchSetStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchReset() {
|
||||
this.queryParam = {
|
||||
type:'会员',
|
||||
}
|
||||
this.loadData(1);
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="modalWidth"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
style="top:15%;height: 70%;overflow-y: hidden">
|
||||
<template slot="footer">
|
||||
<a-button key="back" @click="handleCancel">
|
||||
关闭
|
||||
</a-button>
|
||||
</template>
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="标题">
|
||||
<a-input placeholder="请输入标题" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" >
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<a-button type="primary" @click="readAll" icon="book">全部标注已读</a-button>
|
||||
</div>
|
||||
<div style="margin-top: 5px">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="default"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<template slot="customRenderTitle" slot-scope="text, record">
|
||||
<span v-if="record.status =='1'" style="font-weight: bold">{{text}}</span>
|
||||
<span v-if="record.status =='2'">{{text}}</span>
|
||||
</template>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="showAnnouncement(record)">查看</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<show-announcement ref="ShowAnnouncement"></show-announcement>
|
||||
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postAction } from '@/api/manage'
|
||||
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import DynamicNotice from '@/components/tools/DynamicNotice'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "MsgList",
|
||||
mixins: [JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
DynamicNotice,
|
||||
ShowAnnouncement
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"通知",
|
||||
modalWidth:800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
queryParam: {
|
||||
name: ''
|
||||
},
|
||||
ipagination:{
|
||||
pageSize: 5,
|
||||
pageSizeOptions: ['5','10', '20', '30']
|
||||
},
|
||||
columns: [{
|
||||
title: '标题',
|
||||
dataIndex: 'msgTitle',
|
||||
scopedSlots: { customRender: 'customRenderTitle' },
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
title: '消息类型',
|
||||
dataIndex: 'type',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'createTimeStr',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
width: 50
|
||||
}],
|
||||
url: {
|
||||
list: "/msg/list",
|
||||
batchUpdateStatus:"/msg/batchUpdateStatus",
|
||||
readAllMsg:"/msg/readAllMsg",
|
||||
},
|
||||
loading:false,
|
||||
openPath:'',
|
||||
formData:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleDetail: function(){
|
||||
this.visible = true
|
||||
},
|
||||
showAnnouncement(record){
|
||||
postAction(this.url.batchUpdateStatus,{ids:record.id, status: '2'}).then((res)=>{
|
||||
if(res && res.code === 200){
|
||||
this.loadData();
|
||||
}
|
||||
});
|
||||
if(record.openType==='component'){
|
||||
this.openPath = record.openPage;
|
||||
this.formData = {id:record.busId};
|
||||
this.$refs.showDynamNotice.detail();
|
||||
}else{
|
||||
this.$refs.ShowAnnouncement.detail(record);
|
||||
}
|
||||
},
|
||||
readAll(){
|
||||
let that = this;
|
||||
that.$confirm({
|
||||
title:"确认操作",
|
||||
content:"是否全部标注已读?",
|
||||
onOk: function(){
|
||||
postAction(that.url.readAllMsg).then((res)=>{
|
||||
if(res && res.code === 200){
|
||||
that.$message.success(res.data);
|
||||
that.loadData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.ant-card-body .table-operator{
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.anty-row-operator button{margin: 0 5px}
|
||||
.ant-btn-danger{background-color: #ffffff}z
|
||||
|
||||
.ant-modal-cust-warp{height: 100%}
|
||||
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
|
||||
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
|
||||
</style>
|
||||
@@ -0,0 +1,535 @@
|
||||
<template xmlns:background-color="http://www.w3.org/1999/xhtml">
|
||||
<a-row :gutter="10">
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 按钮操作区域 -->
|
||||
<a-row style="margin-left: 14px">
|
||||
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd()" type="primary">添加机构</a-button>
|
||||
<a-button v-if="btnEnableList.indexOf(1)>-1" title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>
|
||||
<a-button @click="refresh" type="default" icon="reload">刷新</a-button>
|
||||
</a-row>
|
||||
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
|
||||
<a-alert type="info" :showIcon="true">
|
||||
<div slot="message">
|
||||
当前选择:<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
|
||||
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
|
||||
</div>
|
||||
</a-alert>
|
||||
<!-- 树-->
|
||||
<a-col :md="10" :sm="24">
|
||||
<template>
|
||||
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">
|
||||
<span style="user-select: none">
|
||||
<a-tree
|
||||
checkable
|
||||
multiple
|
||||
@select="onSelect"
|
||||
@check="onCheck"
|
||||
@rightClick="rightHandle"
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="departTree"
|
||||
:checkStrictly="checkStrictly"
|
||||
:expandedKeys="iExpandedKeys"
|
||||
:autoExpandParent="true"
|
||||
@expand="onExpand"/>
|
||||
</span>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
</a-col>
|
||||
</div>
|
||||
</a-card>
|
||||
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
|
||||
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
|
||||
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
|
||||
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
|
||||
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
|
||||
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
树操作 <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
</a-col>
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-card :bordered="false" v-if="selectedKeys.length>0">
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator="['orgAbr', validatorRules.orgAbr ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
|
||||
<a-input placeholder="请输入编号" v-decorator="['orgNo', validatorRules.orgNo ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级机构">
|
||||
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
|
||||
allow-clear treeDefaultExpandAll="true"
|
||||
:treeData="treeData" v-model="model.parentId" placeholder="请选择上级机构">
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
||||
<a-input-number v-decorator="[ 'sort' ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="[ 'remark' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div class="anty-form-btn">
|
||||
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
|
||||
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
<a-card v-else >
|
||||
<a-empty>
|
||||
<span slot="description"> 请先选择一个机构! </span>
|
||||
</a-empty>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<organization-modal ref="organizationModal" @ok="loadTree"></organization-modal>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import OrganizationModal from './modules/OrganizationModal'
|
||||
import pick from 'lodash.pick'
|
||||
import {queryOrganizationTreeList,queryOrganizationById, checkOrganization, deleteByDepartId} from '@/api/api'
|
||||
import {httpAction, deleteAction} from '@/api/manage'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
export default {
|
||||
name: 'OrganizationList',
|
||||
mixins: [JeecgListMixin],
|
||||
components: {
|
||||
OrganizationModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
iExpandedKeys: [],
|
||||
loading: false,
|
||||
currFlowId: '',
|
||||
currFlowName: '',
|
||||
disable: true,
|
||||
treeData: [],
|
||||
visible: false,
|
||||
departTree: [],
|
||||
rightClickSelectedKey: '',
|
||||
rightClickSelectedOrgCode: '',
|
||||
hiding: true,
|
||||
model: {},
|
||||
dropTrigger: '',
|
||||
depart: {},
|
||||
disableSubmit: false,
|
||||
checkedKeys: [],
|
||||
selectedKeys: [],
|
||||
autoIncr: 1,
|
||||
currSelected: {},
|
||||
allTreeKeys:[],
|
||||
checkStrictly: true,
|
||||
form: this.$form.createForm(this),
|
||||
labelCol: {
|
||||
xs: {span: 24},
|
||||
sm: {span: 5}
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: {span: 24},
|
||||
sm: {span: 16}
|
||||
},
|
||||
graphDatasource: {
|
||||
nodes: [],
|
||||
edges: []
|
||||
},
|
||||
validatorRules: {
|
||||
orgAbr: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!'},
|
||||
{ validator: this.validateName}
|
||||
]
|
||||
},
|
||||
orgNo: {rules: [{required: true, message: '请输入编码!'}]}
|
||||
},
|
||||
url: {
|
||||
delete: '/organization/delete',
|
||||
edit: '/organization/update',
|
||||
deleteBatch: '/organization/deleteBatch'
|
||||
},
|
||||
orgCategoryDisabled:false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
this.refresh();
|
||||
},
|
||||
loadTree() {
|
||||
var that = this
|
||||
that.treeData = []
|
||||
that.departTree = []
|
||||
let params = {};
|
||||
params.id='';
|
||||
queryOrganizationTreeList(params).then((res) => {
|
||||
if (res) {
|
||||
//机构全选后,再添加机构,选中数量增多
|
||||
this.allTreeKeys = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
let temp = res[i]
|
||||
that.treeData.push(temp)
|
||||
that.departTree.push(temp)
|
||||
that.setThisExpandedKeys(temp)
|
||||
that.getAllKeys(temp);
|
||||
// console.log(temp.id)
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
setThisExpandedKeys(node) {
|
||||
if (node.children && node.children.length > 0) {
|
||||
this.iExpandedKeys.push(node.key)
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.setThisExpandedKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true
|
||||
this.loadTree()
|
||||
},
|
||||
// 右键操作方法
|
||||
rightHandle(node) {
|
||||
this.dropTrigger = 'contextmenu'
|
||||
console.log(node.node.eventKey)
|
||||
this.rightClickSelectedKey = node.node.eventKey
|
||||
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
|
||||
},
|
||||
onExpand(expandedKeys) {
|
||||
console.log('onExpand', expandedKeys)
|
||||
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
|
||||
// or, you can remove all expanded children keys.
|
||||
this.iExpandedKeys = expandedKeys
|
||||
},
|
||||
backFlowList() {
|
||||
this.$router.back(-1)
|
||||
},
|
||||
// 右键点击下拉框改变事件
|
||||
dropStatus(visible) {
|
||||
if (visible == false) {
|
||||
this.dropTrigger = ''
|
||||
}
|
||||
},
|
||||
// 右键店家下拉关闭下拉框
|
||||
closeDrop() {
|
||||
this.dropTrigger = ''
|
||||
},
|
||||
addRootNode() {
|
||||
this.$refs.nodeModal.add(this.currFlowId, '')
|
||||
},
|
||||
batchDel: function () {
|
||||
console.log(this.checkedKeys)
|
||||
if (this.checkedKeys.length <= 0) {
|
||||
this.$message.warning('请选择一条记录!')
|
||||
} else {
|
||||
var ids = ''
|
||||
for (var a = 0; a < this.checkedKeys.length; a++) {
|
||||
ids += this.checkedKeys[a] + ','
|
||||
}
|
||||
var that = this
|
||||
this.$confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据?',
|
||||
onOk: function () {
|
||||
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
that.$message.success(res.msg)
|
||||
that.loadTree()
|
||||
that.onClearSelected()
|
||||
} else {
|
||||
that.$message.warning(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
nodeModalOk() {
|
||||
this.loadTree()
|
||||
},
|
||||
nodeModalClose() {
|
||||
},
|
||||
hide() {
|
||||
console.log(111)
|
||||
this.visible = false
|
||||
},
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log('onCheck', checkedKeys, info)
|
||||
this.hiding = false
|
||||
//this.checkedKeys = checkedKeys.checked
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = checkedKeys.checked;
|
||||
}else{
|
||||
this.checkedKeys = checkedKeys
|
||||
}
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
},
|
||||
onSelect(selectedKeys, e) {
|
||||
console.log('selected', selectedKeys, e)
|
||||
this.hiding = false
|
||||
let record = e.node.dataRef
|
||||
let params = {};
|
||||
params.id=record.id;
|
||||
queryOrganizationById(params).then((res) => {
|
||||
if (res && res.code == 200) {
|
||||
if(res.data){
|
||||
record.orgAbr = res.data.orgAbr;
|
||||
record.orgNo = res.data.orgNo;
|
||||
record.parentId = res.data.parentId;
|
||||
record.sort = res.data.sort;
|
||||
record.remark = res.data.remark;
|
||||
console.log('onSelect-record', record)
|
||||
this.currSelected = Object.assign({}, record)
|
||||
this.model = this.currSelected
|
||||
this.selectedKeys = [record.key]
|
||||
this.model.parentId = record.parentId
|
||||
this.setValuesToForm(record)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 触发onSelect事件时,为机构树右侧的form表单赋值
|
||||
setValuesToForm(record) {
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(record, 'orgAbr', 'orgNo', 'parentId', 'sort', 'remark'))
|
||||
})
|
||||
},
|
||||
getCurrSelectedTitle() {
|
||||
return !this.currSelected.title ? '' : this.currSelected.title
|
||||
},
|
||||
onClearSelected() {
|
||||
this.hiding = true
|
||||
this.checkedKeys = []
|
||||
this.currSelected = {}
|
||||
this.form.resetFields()
|
||||
this.selectedKeys = []
|
||||
this.$refs.departAuth.departId = ''
|
||||
},
|
||||
handleNodeTypeChange(val) {
|
||||
this.currSelected.nodeType = val
|
||||
},
|
||||
notifyTriggerTypeChange(value) {
|
||||
this.currSelected.notifyTriggerType = value
|
||||
},
|
||||
receiptTriggerTypeChange(value) {
|
||||
this.currSelected.receiptTriggerType = value
|
||||
},
|
||||
submitCurrForm() {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
if (!this.currSelected.id) {
|
||||
this.$message.warning('请点击选择要修改机构!')
|
||||
return
|
||||
}
|
||||
|
||||
let formData = Object.assign(this.currSelected, values)
|
||||
console.log('Received values of form: ', formData)
|
||||
httpAction(this.url.edit, formData, 'put').then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('保存成功!')
|
||||
this.loadTree()
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
emptyCurrForm() {
|
||||
this.form.resetFields()
|
||||
},
|
||||
nodeSettingFormSubmit() {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log('Received values of form: ', values)
|
||||
}
|
||||
})
|
||||
},
|
||||
openSelect() {
|
||||
this.$refs.sysDirectiveModal.show()
|
||||
},
|
||||
validateName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkOrganization(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.organizationModal.add()
|
||||
this.$refs.organizationModal.title = '新增'
|
||||
},
|
||||
handleDelete() {
|
||||
var that = this
|
||||
this.$confirm({
|
||||
title: '确认删除',
|
||||
content: '确定要删除此机构吗?',
|
||||
onOk: function () {
|
||||
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => {
|
||||
if (resp.success) {
|
||||
//删除成功后,去除已选中中的数据
|
||||
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
|
||||
that.$message.success('删除成功!')
|
||||
that.loadTree()
|
||||
//删除后同步清空右侧基本信息内容
|
||||
let orgCode=that.form.getFieldValue("orgCode");
|
||||
if(orgCode && orgCode === that.rightClickSelectedOrgCode){
|
||||
that.onClearSelected()
|
||||
}
|
||||
} else {
|
||||
that.$message.warning('删除失败!')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDirectiveOk(record) {
|
||||
console.log('选中指令数据', record)
|
||||
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode})
|
||||
this.currSelected.sysCode = record.sysCode
|
||||
},
|
||||
getFlowGraphData(node) {
|
||||
this.graphDatasource.nodes.push({
|
||||
id: node.id,
|
||||
text: node.flowNodeName
|
||||
})
|
||||
if (node.children.length > 0) {
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
let temp = node.children[a]
|
||||
this.graphDatasource.edges.push({
|
||||
source: node.id,
|
||||
target: temp.id
|
||||
})
|
||||
this.getFlowGraphData(temp)
|
||||
}
|
||||
}
|
||||
},
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
expandAll () {
|
||||
this.iExpandedKeys = this.allTreeKeys
|
||||
},
|
||||
closeAll () {
|
||||
this.iExpandedKeys = []
|
||||
},
|
||||
checkALL () {
|
||||
this.checkStriccheckStrictlytly = false
|
||||
this.checkedKeys = this.allTreeKeys
|
||||
},
|
||||
cancelCheckALL () {
|
||||
//this.checkedKeys = this.defaultCheckedKeys
|
||||
this.checkedKeys = []
|
||||
},
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
getAllKeys(node) {
|
||||
// console.log('node',node);
|
||||
this.allTreeKeys.push(node.key)
|
||||
if (node.children && node.children.length > 0) {
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.getAllKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
}
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
|
||||
},
|
||||
created() {
|
||||
this.currFlowId = this.$route.params.id
|
||||
this.currFlowName = this.$route.params.name
|
||||
// this.loadTree()
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.ant-card-body .table-operator {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.anty-form-btn {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.anty-form-btn button {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
.anty-node-layout .ant-layout-header {
|
||||
padding-right: 0
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.header button {
|
||||
margin: 0 3px
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
}
|
||||
|
||||
#app .desktop {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
/** Button按钮间距 */
|
||||
.ant-btn {
|
||||
margin-left: 3px
|
||||
}
|
||||
|
||||
.drawer-bootom-button {
|
||||
/*position: absolute;*/
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: left;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入姓名查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select v-model="queryParam.type" placeholder="请选择类型">
|
||||
<a-select-option value="">请选择</a-select-option>
|
||||
<a-select-option value="业务员">业务员</a-select-option>
|
||||
<a-select-option value="仓管员">仓管员</a-select-option>
|
||||
<a-select-option value="财务员">财务员</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-dropdown>
|
||||
<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>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@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>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<person-modal ref="modalForm" @ok="modalFormOk"></person-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import PersonModal from './modules/PersonModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "PersonList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
PersonModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',type:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
align:"center",
|
||||
dataIndex: 'name',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
align:"center",
|
||||
dataIndex: 'type',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/person/list",
|
||||
delete: "/person/delete",
|
||||
deleteBatch: "/person/deleteBatch"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<platform-config-modal ref="modalForm" @ok="modalFormOk"></platform-config-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import PlatformConfigModal from './modules/PlatformConfigModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "PlatformConfigList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
PlatformConfigModal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
currentRoleId: '',
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {platformKey:'',},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '配置名称',
|
||||
dataIndex: 'platformKeyInfo',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '配置值',
|
||||
dataIndex: 'platformValue',
|
||||
width: 500
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/platformConfig/list",
|
||||
delete: "/platformConfig/delete",
|
||||
deleteBatch: "/platformConfig/deleteBatch"
|
||||
},
|
||||
}
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
<a-button type="primary" style="margin-left: 8px" @click="writeCode">填写激活码</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin-top: 5px">
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importUrl" @change="handleImportJar">
|
||||
<a-popover title="导入注意点">
|
||||
<template slot="content">
|
||||
<p>请选择需要导入的插件jar包</p>
|
||||
</template>
|
||||
<a-button type="primary" icon="import">上传插件包</a-button>
|
||||
</a-popover>
|
||||
</a-upload>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="uploadTemplate(record)" >上传页面</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定要开启该插件吗?" @confirm="() => startPlugin(record.pluginDescriptor.pluginId)">
|
||||
<a>开启</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定要停止该插件吗?" @confirm="() => stopPlugin(record.pluginDescriptor.pluginId)">
|
||||
<a>停止</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="确定要卸载该插件吗?" @confirm="() => uninstallPlugin(record.pluginDescriptor.pluginId)">
|
||||
<a>卸载</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<span slot="linkInfo" slot-scope="text, record">
|
||||
<a @click="linkTo(record)" target='_blank'>链接跳转</a>
|
||||
</span>
|
||||
<template slot="customRenderFlag" slot-scope="pluginState">
|
||||
<a-tag v-if="pluginState=='STARTED'" color="green">启用</a-tag>
|
||||
<a-tag v-if="pluginState=='STOPPED'" color="orange">停止</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<plugin-modal ref="modalForm" @ok="modalFormOk"></plugin-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import PluginModal from './modules/PluginModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import {postAction} from '@/api/manage';
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import { filterObj } from '@/utils/util'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "PluginList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
PluginModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{title: '名称', dataIndex: '', width: 120,
|
||||
customRender:function (t,r,index) {
|
||||
if (r) {
|
||||
var desc = r.pluginDescriptor.pluginDescription;
|
||||
if(desc.indexOf("|")){
|
||||
var arr = desc.split("|");
|
||||
return arr[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '标识', dataIndex: '', width: 180,
|
||||
customRender:function (t,r,index) {
|
||||
if (r) {
|
||||
return r.pluginDescriptor.pluginId;
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '版本', dataIndex: '', width: 120,
|
||||
customRender:function (t,r,index) {
|
||||
if (r) {
|
||||
return r.pluginDescriptor.version;
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '作者', dataIndex: '', width: 100,
|
||||
customRender:function (t,r,index) {
|
||||
if (r) {
|
||||
return r.pluginDescriptor.provider;
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '页面链接', dataIndex: '', width: 250,
|
||||
scopedSlots: { customRender: 'linkInfo' }
|
||||
},
|
||||
{title: '状态', dataIndex: 'pluginState', width: 80, align: "center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/plugin/list",
|
||||
delete: "/plugin/delete",
|
||||
deleteBatch: "/plugin/deleteBatch",
|
||||
importJarUrl: "/plugin/uploadInstallPluginJar",
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}${this.url.importJarUrl}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getQueryParams() {
|
||||
//获取查询条件
|
||||
let sqp = {}
|
||||
if(this.superQueryParams){
|
||||
sqp['superQueryParams']=encodeURI(this.superQueryParams)
|
||||
sqp['superQueryMatchType'] = this.superQueryMatchType
|
||||
}
|
||||
let param = {};
|
||||
param.name = this.queryParam.name;
|
||||
param.currentPage = this.ipagination.current;
|
||||
param.pageSize = this.ipagination.pageSize;
|
||||
return filterObj(param);
|
||||
},
|
||||
writeCode() {
|
||||
this.$refs.modalForm.edit();
|
||||
this.$refs.modalForm.title = "填写激活码";
|
||||
this.$refs.modalForm.disableSubmit = false;
|
||||
},
|
||||
linkTo(record) {
|
||||
let desc = record.pluginDescriptor.pluginDescription;
|
||||
if(desc.indexOf("|")){
|
||||
let arr = desc.split("|");
|
||||
window.location.href = arr[1]
|
||||
}
|
||||
},
|
||||
uploadTemplate(record) {
|
||||
var rootPath = record.path.substring(0, record.path.indexOf("plugins"));
|
||||
this.$message.info('请将页面上传到服务器目录:' + " /前端根目录/plugins/");
|
||||
},
|
||||
startPlugin(pluginId) {
|
||||
postAction('/plugin/start/' + pluginId).then((res)=>{
|
||||
if(res && res.code == 200) {
|
||||
this.loadData();
|
||||
}
|
||||
})
|
||||
},
|
||||
stopPlugin(pluginId) {
|
||||
postAction('/plugin/stop/' + pluginId).then((res)=>{
|
||||
if(res && res.code == 200) {
|
||||
this.loadData();
|
||||
}
|
||||
})
|
||||
},
|
||||
uninstallPlugin(pluginId) {
|
||||
postAction('/plugin/uninstall/' + pluginId).then((res)=>{
|
||||
if(res && res.code == 200) {
|
||||
this.loadData();
|
||||
}
|
||||
})
|
||||
},
|
||||
handleImportJar(info){
|
||||
if (info.file.status !== 'uploading') {
|
||||
console.log(info.file, info.fileList);
|
||||
}
|
||||
if (info.file.status === 'done') {
|
||||
if (info.file.response) {
|
||||
if (info.file.response.code === 200) {
|
||||
this.$message.success(info.file.response.data)
|
||||
this.loadData()
|
||||
}
|
||||
} else {
|
||||
this.$message.error(info.file.response.data);
|
||||
}
|
||||
} else if (info.file.status === 'error') {
|
||||
this.$message.error(`文件上传失败: ${info.file.msg} `);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="角色名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入角色名称查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-dropdown>
|
||||
<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>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<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)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<role-modal ref="modalForm" @ok="modalFormOk"></role-modal>
|
||||
<role-function-modal ref="roleFunctionModal" @ok="roleFunctionModalFormOk"></role-function-modal>
|
||||
<role-push-btn-modal ref="rolePushBtnModal" @ok="modalFormOk"></role-push-btn-modal>
|
||||
<a-modal v-model="roleFunctionModalVisible" title="操作提示" @ok="handleTipOk">
|
||||
<p>分配功能已经操作成功!现在继续<b>分配按钮</b>吗?</p>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import RoleModal from './modules/RoleModal'
|
||||
import RoleFunctionModal from './modules/RoleFunctionModal'
|
||||
import RolePushBtnModal from './modules/RolePushBtnModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "RoleList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
RoleModal,
|
||||
RoleFunctionModal,
|
||||
RolePushBtnModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
description: '角色管理页面',
|
||||
roleFunctionModalVisible: false,
|
||||
currentRoleId: '',
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '角色名称',
|
||||
align:"center",
|
||||
dataIndex: 'name',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '数据类型',
|
||||
align:"center",
|
||||
dataIndex: 'type',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
dataIndex: 'description',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
width: 150,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/role/list",
|
||||
delete: "/role/delete",
|
||||
deleteBatch: "/role/deleteBatch"
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSetFunction(record) {
|
||||
this.$refs.roleFunctionModal.edit(record);
|
||||
this.$refs.roleFunctionModal.title = "分配功能【分配之后请继续分配按钮】";
|
||||
this.$refs.roleFunctionModal.disableSubmit = false;
|
||||
},
|
||||
handleSetPushBtn(roleId) {
|
||||
this.$refs.rolePushBtnModal.edit(roleId);
|
||||
this.$refs.rolePushBtnModal.title = "分配按钮";
|
||||
this.$refs.rolePushBtnModal.disableSubmit = false;
|
||||
},
|
||||
roleFunctionModalFormOk(id) {
|
||||
//重载列表
|
||||
this.loadData();
|
||||
this.roleFunctionModalVisible = true;
|
||||
this.currentRoleId = id
|
||||
},
|
||||
handleTipOk() {
|
||||
if(this.currentRoleId) {
|
||||
this.roleFunctionModalVisible = false;
|
||||
this.handleSetPushBtn(this.currentRoleId)
|
||||
}
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="12">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form" id="systemConfigModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司名称">
|
||||
<a-input placeholder="请输入公司名称" v-decorator.trim="[ 'companyName', validatorRules.companyName]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人">
|
||||
<a-input placeholder="请输入联系人" v-decorator.trim="[ 'companyContacts' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司地址">
|
||||
<a-input placeholder="请输入公司地址" v-decorator.trim="[ 'companyAddress' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司电话">
|
||||
<a-input placeholder="请输入公司电话" v-decorator.trim="[ 'companyTel' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司传真">
|
||||
<a-input placeholder="请输入公司传真" v-decorator.trim="[ 'companyFax' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司邮编">
|
||||
<a-input placeholder="请输入公司邮编" v-decorator.trim="[ 'companyPostCode' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库权限">
|
||||
<a-switch checked-children="启用" un-checked-children="关闭" v-model="depotFlagSwitch" @change="onDepotChange"></a-switch>
|
||||
(如果启用则需要到<b>用户管理</b>进行<b>分配仓库</b>)
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户权限">
|
||||
<a-switch checked-children="启用" un-checked-children="关闭" v-model="customerFlagSwitch" @change="onCustomerChange"></a-switch>
|
||||
(如果启用则需要到<b>用户管理</b>进行<b>分配客户</b>)
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="负库存">
|
||||
<a-switch checked-children="启用" un-checked-children="关闭" v-model="minusStockFlagSwitch" @change="onMinusStockChange"></a-switch>
|
||||
(如果启用则单据支持负库存,批次商品除外)
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="12" align="middle">
|
||||
<a-button type="primary" @click="handleOk">保存</a-button>
|
||||
<a-button style="margin-left:20px" @click="handleReset">重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</template>
|
||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSystemConfig,editSystemConfig,checkSystemConfig } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import {getAction } from '@/api/manage'
|
||||
export default {
|
||||
name: "SystemConfigList",
|
||||
// mixins: [mixinDevice],
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
cardStyle: '',
|
||||
visible: true,
|
||||
model: {},
|
||||
depotFlagSwitch: false, //仓库权限状态
|
||||
customerFlagSwitch: false, //客户权限状态
|
||||
minusStockFlagSwitch: false, //负库存状态
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
companyName:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入公司名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.init()
|
||||
if(this.isDesktop()) {
|
||||
this.cardStyle = 'height:' + (document.documentElement.clientHeight-125) + 'px'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDepotChange(checked) {
|
||||
this.model.depotFlag = checked?'1':'0'
|
||||
},
|
||||
onCustomerChange(checked) {
|
||||
this.model.customerFlag = checked?'1':'0'
|
||||
},
|
||||
onMinusStockChange(checked) {
|
||||
this.model.minusStockFlag = checked?'1':'0'
|
||||
},
|
||||
init () {
|
||||
let param = {
|
||||
search: {"companyName":""},
|
||||
currentPage: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
getAction('/systemConfig/list', param).then((res)=>{
|
||||
if(res.code === 200){
|
||||
let record = res.data.rows[0]
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'companyName', 'companyContacts', 'companyAddress',
|
||||
'companyTel', 'companyFax', 'companyPostCode', 'depotFlag', 'customerFlag', 'minusStockFlag'))
|
||||
autoJumpNextInput('systemConfigModal')
|
||||
});
|
||||
if(record.id) {
|
||||
if (record.depotFlag != null) {
|
||||
this.depotFlagSwitch = record.depotFlag == '1' ? true : false;
|
||||
}
|
||||
if (record.customerFlag != null) {
|
||||
this.customerFlagSwitch = record.customerFlag == '1' ? true : false;
|
||||
}
|
||||
if (record.minusStockFlag != null) {
|
||||
this.minusStockFlagSwitch = record.minusStockFlag == '1' ? true : false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.info(res.data);
|
||||
}
|
||||
})
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addSystemConfig(formData);
|
||||
}else{
|
||||
obj=editSystemConfig(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
this.init()
|
||||
that.$message.info('保存成功!');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReset () {
|
||||
this.form.resetFields();
|
||||
this.depotFlagSwitch = false
|
||||
this.customerFlagSwitch = false
|
||||
this.minusStockFlagSwitch = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="输入登录名称模糊查询" v-model="queryParam.loginName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="租户类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select v-model="queryParam.type" placeholder="请选择租户类型">
|
||||
<a-select-option value="0">免费租户</a-select-option>
|
||||
<a-select-option value="1">付费租户</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="租户状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select v-model="queryParam.enabled" placeholder="请选择操作状态">
|
||||
<a-select-option value="1">启用</a-select-option>
|
||||
<a-select-option value="0">禁用</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="border-top: 5px">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-dropdown>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchSetStatus(1)"><a-icon type="check-square"/>启用</a-menu-item>
|
||||
<a-menu-item key="2" @click="batchSetStatus(0)"><a-icon type="close-square"/>禁用</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
批量操作
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
bordered
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderType" slot-scope="type">
|
||||
<a-tag v-if="type==0">免费租户</a-tag>
|
||||
<a-tag v-if="type==1" color="green">付费租户</a-tag>
|
||||
</template>
|
||||
<template slot="customRenderEnabled" slot-scope="enabled">
|
||||
<a-tag v-if="enabled" color="green">启用</a-tag>
|
||||
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<tenant-modal ref="modalForm" @ok="modalFormOk"></tenant-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import TenantModal from './modules/TenantModal'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import JInput from '@/components/jeecg/JInput'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "TenantList",
|
||||
mixins: [JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
TenantModal,
|
||||
JInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
queryParam: {
|
||||
loginName: '',
|
||||
type: '',
|
||||
enabled: ''
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{ title: '登录名称', dataIndex: 'loginName', width: 100, align: "center"},
|
||||
{ title: '用户数量限制', dataIndex: 'userNumLimit', width: 100, align: "center"},
|
||||
{ title: '租户类型',dataIndex: 'type',width:70,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderType' }
|
||||
},
|
||||
{ title: '租户状态',dataIndex: 'enabled',width:70,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderEnabled' }
|
||||
},
|
||||
{ title: '创建时间', dataIndex: 'createTimeStr', width: 100, align: "center"},
|
||||
{ title: '到期时间', dataIndex: 'expireTimeStr', width: 100, align: "center"},
|
||||
{ title: '描述', dataIndex: 'remark', width: 200, align: "center", ellipsis:true},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 100
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/tenant/list",
|
||||
batchSetStatusUrl: "/tenant/batchSetStatus"
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入计量单位查询" v-model="queryParam.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</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-dropdown>
|
||||
<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>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@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>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<unit-modal ref="modalForm" @ok="modalFormOk"></unit-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import UnitModal from './modules/UnitModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "UnitList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
UnitModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {name:'',type:''},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{ title: '计量单位', align:"center", dataIndex: 'name', width:150 },
|
||||
{ title: '基本单位', align:"center", dataIndex: 'basicUnit', width:100 },
|
||||
{ title: '副单位', align:"center", dataIndex: 'otherUnit', width:100,
|
||||
// customRender:function (t,r,index) {
|
||||
// if (r) {
|
||||
// return r.otherUnit + '=' + r.ratio + r.basicUnit;
|
||||
// }
|
||||
// }
|
||||
},
|
||||
{ title: '副单位2', align:"center", dataIndex: 'otherUnitTwo', width:100,
|
||||
customRender:function (t,r,index) {
|
||||
if (r) {
|
||||
if(r.otherUnitTwo) {
|
||||
return r.otherUnitTwo + '=' + r.ratioTwo + r.basicUnit;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ title: '副单位3', align:"center", dataIndex: 'otherUnitThree', width:100,
|
||||
customRender:function (t,r,index) {
|
||||
if (r) {
|
||||
if(r.otherUnitThree) {
|
||||
return r.otherUnitThree + '=' + r.ratioThree + r.basicUnit;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width:150,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/unit/list",
|
||||
delete: "/unit/delete",
|
||||
deleteBatch: "/unit/deleteBatch"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="输入登录名称模糊查询" v-model="queryParam.loginName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="输入用户姓名模糊查询" v-model="queryParam.userName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="border-top: 5px">
|
||||
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<a-dropdown>
|
||||
<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="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(0)"><a-icon type="check-square"/>启用</a-menu-item>
|
||||
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(2)"><a-icon type="close-square"/>禁用</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
批量操作
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
bordered
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a v-if="btnEnableList.indexOf(1)>-1 && depotFlag === '1' " @click="btnSetDepot(record)">分配仓库</a>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1 && depotFlag === '1'" type="vertical" />
|
||||
<a v-if="btnEnableList.indexOf(1)>-1 && customerFlag === '1'" @click="btnSetCustomer(record)">分配客户</a>
|
||||
<a-divider v-if="btnEnableList.indexOf(1)>-1 && customerFlag === '1'" 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)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical"/>
|
||||
<a-popconfirm title="确定重置密码为123456吗?" @confirm="() => handleReset(record.id)">
|
||||
<a>重置密码</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="status">
|
||||
<a-tag v-if="status===0" color="green">启用</a-tag>
|
||||
<a-tag v-if="status===2" color="orange">禁用</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
|
||||
<user-depot-modal ref="userDepotModal" @ok="modalFormOk"></user-depot-modal>
|
||||
<user-customer-modal ref="userCustomerModal" @ok="modalFormOk"></user-customer-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import UserModal from './modules/UserModal'
|
||||
import UserDepotModal from './modules/UserDepotModal'
|
||||
import UserCustomerModal from './modules/UserCustomerModal'
|
||||
import {postAction} from '@/api/manage';
|
||||
import {getCurrentSystemConfig} from '@/api/api'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import JInput from '@/components/jeecg/JInput'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "UserList",
|
||||
mixins: [JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
UserModal,
|
||||
UserDepotModal,
|
||||
UserCustomerModal,
|
||||
JInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
queryParam: {},
|
||||
depotFlag: '0',
|
||||
customerFlag: '0',
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{ title: '登录名称', dataIndex: 'loginName', width: 100, align: "center"},
|
||||
{ title: '用户姓名', dataIndex: 'username', width: 100, align: "center"},
|
||||
{ title: '用户类型', dataIndex: 'userType', width: 80, align: "center" },
|
||||
{ title: '角色', dataIndex: 'roleName', width: 100, align: "center"},
|
||||
{ title: '机构', dataIndex: 'orgAbr', width: 115, align: "center"},
|
||||
{ title: '电话号码', dataIndex: 'phonenum', width: 120, align: "center"},
|
||||
{ title: '排序', dataIndex: 'userBlngOrgaDsplSeq', width: 60, align: "center"},
|
||||
{ title: '状态',dataIndex: 'status',width:70,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 260
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/user/list",
|
||||
delete: "/user/delete",
|
||||
deleteBatch: "/user/deleteBatch",
|
||||
resetPwd: "/user/resetPwd",
|
||||
batchSetStatusUrl: "/user/batchSetStatus"
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getSystemConfig()
|
||||
},
|
||||
methods: {
|
||||
getSystemConfig() {
|
||||
getCurrentSystemConfig().then((res) => {
|
||||
if(res.code === 200 && res.data){
|
||||
this.depotFlag = res.data.depotFlag
|
||||
this.customerFlag = res.data.customerFlag
|
||||
}
|
||||
})
|
||||
},
|
||||
searchQuery() {
|
||||
this.loadData(1);
|
||||
this.getSystemConfig();
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.loadData(1);
|
||||
this.getSystemConfig();
|
||||
},
|
||||
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
|
||||
}
|
||||
},
|
||||
handleReset(id) {
|
||||
let that = this;
|
||||
postAction(that.url.resetPwd, {id: id}).then((res) => {
|
||||
if(res.code === 200){
|
||||
that.$message.info('重置密码成功!');
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
btnSetDepot(record) {
|
||||
this.$refs.userDepotModal.edit(record);
|
||||
this.$refs.userDepotModal.title = "分配仓库";
|
||||
this.$refs.userDepotModal.disableSubmit = false;
|
||||
},
|
||||
btnSetCustomer(record) {
|
||||
this.$refs.userCustomerModal.edit(record);
|
||||
this.$refs.userCustomerModal.title = "分配客户";
|
||||
this.$refs.userCustomerModal.disableSubmit = false;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :style="cardStyle" :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称查询" v-model="queryParam.supplier"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入手机号码查询" v-model="queryParam.telephone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入联系电话查询" v-model="queryParam.phonenum"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" style="margin-top: 5px">
|
||||
<a-button v-if="btnEnableList.indexOf(1)>-1" type="primary" icon="plus" @click="handleAdd">新增</a-button>
|
||||
<a-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-popover title="导入注意点">
|
||||
<template slot="content">
|
||||
<p><a target="_blank" href="/doc/vendor_template.xls"><b>供应商Excel模板下载</b></a></p>
|
||||
</template>
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-popover>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('供应商信息')">导出</a-button>
|
||||
<a-dropdown>
|
||||
<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="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
|
||||
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
批量操作 <a-icon type="down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:components="drag(columns)"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@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>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="enabled">
|
||||
<a-tag v-if="enabled" color="green">启用</a-tag>
|
||||
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<vendor-modal ref="modalForm" @ok="modalFormOk"></vendor-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||
<script>
|
||||
import VendorModal from './modules/VendorModal'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { openDownloadDialog, sheet2blob} from "@/utils/util"
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
|
||||
export default {
|
||||
name: "VendorList",
|
||||
mixins:[JeecgListMixin,tableDragResizeMixin],
|
||||
components: {
|
||||
VendorModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
span: 5
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 18,
|
||||
offset: 1
|
||||
},
|
||||
// 查询条件
|
||||
queryParam: {
|
||||
supplier:'',
|
||||
type:'供应商',
|
||||
telephone:'',
|
||||
phonenum:''
|
||||
},
|
||||
ipagination:{
|
||||
pageSizeOptions: ['10', '20', '30', '100', '200']
|
||||
},
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:60,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{ title: '名称',dataIndex: 'supplier',width:150},
|
||||
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
|
||||
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
|
||||
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
|
||||
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
|
||||
{ title: '期初应付',dataIndex: 'beginNeedPay',width:80,align:"center"},
|
||||
{ title: '期末应付',dataIndex: 'allNeedPay',width:80,align:"center"},
|
||||
{ title: '税率(%)', dataIndex: 'taxRate',width:80,align:"center"},
|
||||
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
|
||||
scopedSlots: { customRender: 'customRenderFlag' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/supplier/list",
|
||||
delete: "/supplier/delete",
|
||||
deleteBatch: "/supplier/deleteBatch",
|
||||
importExcelUrl: "/supplier/importVendor",
|
||||
exportXlsUrl: "/supplier/exportExcel",
|
||||
batchSetStatusUrl: "/supplier/batchSetStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchReset() {
|
||||
this.queryParam = {
|
||||
type:'供应商',
|
||||
}
|
||||
this.loadData(1);
|
||||
},
|
||||
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>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less'
|
||||
</style>
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="24">
|
||||
<a-card :bordered="false">
|
||||
<div style="width: 50%; margin: 0 auto">
|
||||
<!-- 本期明细 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<div class="detailed">本期明细</div>
|
||||
</div>
|
||||
<!-- 本期开始时间 -->
|
||||
<div class="table-operator font-size" style="margin: 20px 0px">
|
||||
<p>本期开始时间:2020-20-20 00:00:00</p>
|
||||
</div>
|
||||
<!-- 金额||总计 -->
|
||||
<div class="Statistics font-size">
|
||||
<p>财务营收统计:{{RevenueStatistics}}</p>
|
||||
<p>财务应付统计:{{PayableStatistics}}</p>
|
||||
</div>
|
||||
<div class="Statistics font-size">
|
||||
<p>出库金额总计:{{DeliveryAmount}}</p>
|
||||
<p>入库金额总计:{{ReceiptAmount}}</p>
|
||||
</div>
|
||||
<div class="Statistics font-size">
|
||||
<p>物料金额总计:{{MaterialAmount}}</p>
|
||||
</div>
|
||||
<div class="button">
|
||||
<a-button type="primary" @click="CarryForward">立即结转</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<a-modal v-model="CarryForwardMessage" title="操作提示" @ok="handleTipOk">
|
||||
<p>确定结转嘛?</p>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
</template>
|
||||
<!--power by ji shenghua-->
|
||||
<script>
|
||||
// import InventoryReviewModal from './modules/InventoryReviewModal.vue'
|
||||
// import BillDetail from './dialog/BillDetail'
|
||||
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
// import { BillListMixin } from './mixins/BillListMixin'
|
||||
// import JDate from '@/components/jeecg/JDate'
|
||||
// import Vue from 'vue'
|
||||
// import ListColumnsSetter from '@/components/ListColumnsSetter'
|
||||
// import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
|
||||
export default {
|
||||
name: 'InventorySeason',
|
||||
// mixins: [JeecgListMixin],
|
||||
components: {
|
||||
// InventoryReviewModal,
|
||||
// BillDetail,
|
||||
// JDate,
|
||||
// ListColumnsSetter,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
CarryForwardMessage: false,
|
||||
RevenueStatistics:0.00,
|
||||
PayableStatistics:0.00,
|
||||
DeliveryAmount:0.00,
|
||||
ReceiptAmount:33.33,
|
||||
MaterialAmount:11111.11
|
||||
// 查询条件
|
||||
// queryParam: {
|
||||
// number: '',
|
||||
// materialParam: '',
|
||||
// type: '其它',
|
||||
// subType: '盘点复盘',
|
||||
// roleType: Vue.ls.get('roleType'),
|
||||
// organId: '',
|
||||
// depotId: '',
|
||||
// creator: '',
|
||||
// linkNumber: '',
|
||||
// },
|
||||
// labelCol: {
|
||||
// span: 5,
|
||||
// },
|
||||
// wrapperCol: {
|
||||
// span: 18,
|
||||
// offset: 1,
|
||||
// },
|
||||
// // 表头
|
||||
// columns: [
|
||||
// {
|
||||
// title: '单据编号',
|
||||
// dataIndex: 'number',
|
||||
// width: 160,
|
||||
// align: 'center',
|
||||
// customRender: function (text, record, index) {
|
||||
// if (record.linkNumber) {
|
||||
// return text + '[转]'
|
||||
// } else {
|
||||
// return text
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: '商品信息',
|
||||
// dataIndex: 'materialsList',
|
||||
// width: 220,
|
||||
// align: 'center',
|
||||
// ellipsis: true,
|
||||
// customRender: function (text, record, index) {
|
||||
// if (text) {
|
||||
// return text.replace(',', ',')
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
// { title: '单据日期', dataIndex: 'operTimeStr', width: 145, align: 'center' },
|
||||
// { title: '操作员', dataIndex: 'userName', width: 80, align: 'center', ellipsis: true },
|
||||
// { title: '金额合计', dataIndex: 'totalPrice', width: 80, align: 'center' },
|
||||
// {
|
||||
// title: '状态',
|
||||
// dataIndex: 'status',
|
||||
// width: 80,
|
||||
// align: 'center',
|
||||
// scopedSlots: { customRender: 'customRenderStatus' },
|
||||
// },
|
||||
// {
|
||||
// title: '操作',
|
||||
// dataIndex: 'action',
|
||||
// align: 'center',
|
||||
// width: 150,
|
||||
// scopedSlots: { customRender: 'action' },
|
||||
// },
|
||||
// ],
|
||||
// url: {
|
||||
// list: '/depotHead/list',
|
||||
// delete: '/depotHead/delete',
|
||||
// deleteBatch: '/depotHead/deleteBatch',
|
||||
// batchSetStatusUrl: '/depotHead/batchSetStatus',
|
||||
// },
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
created() {
|
||||
// this.initSupplier()
|
||||
// this.getDepotData()
|
||||
// this.initUser()
|
||||
},
|
||||
methods: {
|
||||
CarryForward() {
|
||||
this.CarryForwardMessage = true
|
||||
},
|
||||
handleTipOk() {
|
||||
this.CarryForwardMessage = false
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* @import '~@assets/less/common.less'; */
|
||||
.detailed {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.Statistics {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.font-size {
|
||||
font-size: 15px;
|
||||
}
|
||||
.ant-btn {
|
||||
width: 140px;
|
||||
height: 40px;
|
||||
}
|
||||
.button {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:20%;height: 60%;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" id="accountModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
|
||||
<a-input placeholder="请输入编号" v-decorator.trim="[ 'serialNo', validatorRules.serialNo]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期初金额">
|
||||
<a-input placeholder="请输入期初金额" v-decorator.trim="[ 'initialAmount' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="当前余额">
|
||||
<a-input placeholder="请输入当前余额" :read-only="true" v-decorator.trim="[ 'currentAmount' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addAccount,editAccount,checkAccount } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "AccountModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateAccountName}
|
||||
]},
|
||||
serialNo:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入编号!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'serialNo', 'initialAmount', 'currentAmount', 'remark'))
|
||||
autoJumpNextInput('accountModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addAccount(formData);
|
||||
}else{
|
||||
obj=editAccount(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateAccountName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkAccount(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:15%;height: 70%;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" id="customerModal">
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'supplier', validatorRules.supplier]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人">
|
||||
<a-input placeholder="请输入联系人" v-decorator.trim="[ 'contacts' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
|
||||
<a-input placeholder="请输入手机号码" v-decorator.trim="[ 'telephone' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
|
||||
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
|
||||
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="传真">
|
||||
<a-input placeholder="请输入传真" v-decorator.trim="[ 'fax' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期初应收">
|
||||
<a-input placeholder="请输入期初应收" v-decorator.trim="[ 'beginNeedGet' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期末应收">
|
||||
<a-input v-decorator.trim="[ 'allNeedGet' ]" :readOnly="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纳税人识别号">
|
||||
<a-input placeholder="请输入纳税人识别号" v-decorator.trim="[ 'taxNum' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="税率(%)">
|
||||
<a-input placeholder="请输入税率(%)" v-decorator.trim="[ 'taxRate' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="开户行">
|
||||
<a-input placeholder="请输入开户行" v-decorator.trim="[ 'bankName' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="账号">
|
||||
<a-input placeholder="请输入账号" v-decorator.trim="[ 'accountNumber' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="地址">
|
||||
<a-input placeholder="请输入地址" v-decorator.trim="[ 'address' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="[ 'description' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSupplier,editSupplier,checkSupplier } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "CustomerModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
supplier:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateSupplierName}
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'supplier', 'contacts', 'telephone', 'email', 'telephone',
|
||||
'phoneNum', 'fax', 'beginNeedGet', 'beginNeedPay', 'allNeedGet', 'allNeedPay', 'taxNum', 'taxRate',
|
||||
'bankName', 'accountNumber', 'address', 'description'))
|
||||
autoJumpNextInput('customerModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
if(this.model.beginNeedGet && this.model.beginNeedPay) {
|
||||
that.$message.warn("期初应收和期初应付不能同时输入");
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
formData.type = "客户";
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addSupplier(formData);
|
||||
}else{
|
||||
obj=editSupplier(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateSupplierName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
type: '客户',
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkSupplier(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:15%;height: 70%;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" id="depotModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库名称">
|
||||
<a-input placeholder="请输入仓库名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库地址">
|
||||
<a-input placeholder="请输入仓库地址" v-decorator.trim="[ 'address' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓储费">
|
||||
<a-input placeholder="请输入仓储费" v-decorator.trim="[ 'warehousing' ]" suffix="元/天/KG"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="搬运费">
|
||||
<a-input placeholder="请输入搬运费" v-decorator.trim="[ 'truckage' ]" suffix="元"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="负责人">
|
||||
<a-select placeholder="选择负责人" v-decorator="[ 'principal' ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
|
||||
{{ item.userName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
||||
<a-input placeholder="请输入排序" v-decorator.trim="[ 'sort' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="[ 'remark' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addDepot,editDepot,checkDepot,getUserList } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "DepotModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
userList: [],
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入仓库名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateDepotName}
|
||||
]}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.initUser()
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,
|
||||
'name', 'address', 'warehousing', 'truckage', 'principal', 'sort', 'remark'))
|
||||
autoJumpNextInput('depotModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addDepot(formData);
|
||||
}else{
|
||||
obj=editDepot(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateDepotName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkDepot(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
initUser() {
|
||||
getUserList({}).then((res)=>{
|
||||
if(res) {
|
||||
this.userList = res;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:10%;height: 90%;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" id="functionModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
|
||||
<a-input placeholder="请输入编号" v-decorator.trim="[ 'number', validatorRules.number]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级编号">
|
||||
<a-input placeholder="请输入上级编号" v-decorator.trim="[ 'parentNumber' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="链接">
|
||||
<a-input placeholder="请输入链接" v-decorator.trim="[ 'url' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="组件">
|
||||
<a-input placeholder="请输入组件" v-decorator.trim="[ 'component' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
||||
<a-input placeholder="请输入排序" v-decorator.trim="[ 'sort' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="功能按钮">
|
||||
<j-select-multiple placeholder="请选择功能按钮" v-model="jselectMultiple.value" :options="jselectMultiple.options"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="图标">
|
||||
<a-input placeholder="请输入图标" v-decorator.trim="[ 'icon' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="是否启用">
|
||||
<a-switch checked-children="启用" un-checked-children="禁用" v-model="enabledSwitch" @change="onChange"/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addFunction,editFunction,checkFunction } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
export default {
|
||||
name: "FunctionModal",
|
||||
components: {
|
||||
JSelectMultiple
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
enabledSwitch: true, //是否启用
|
||||
isReadOnly: false,
|
||||
jselectMultiple: {
|
||||
options: [
|
||||
{ text: '编辑', value: '1' },
|
||||
{ text: '审核', value: '2' },
|
||||
{ text: '反审核', value: '7' },
|
||||
{ text: '导入导出', value: '3' },
|
||||
{ text: '启用禁用', value: '4' },
|
||||
{ text: '打印', value: '5' },
|
||||
{ text: '作废', value: '6' }
|
||||
],
|
||||
value: ''
|
||||
},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validatePersonName}
|
||||
]},
|
||||
type:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择类型!' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
onChange(checked) {
|
||||
this.model.enabled = checked
|
||||
},
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
if(record.enabled!=null){
|
||||
this.enabledSwitch = record.enabled?true:false;
|
||||
}
|
||||
if(this.model.id){
|
||||
this.jselectMultiple.value = record.pushBtn
|
||||
} else {
|
||||
this.jselectMultiple.value = ''
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'number', 'name', 'parentNumber', 'url', 'component', 'sort', 'pushBtn', 'icon', 'enabled'))
|
||||
autoJumpNextInput('functionModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
formData.pushBtn = this.jselectMultiple.value
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addFunction(formData);
|
||||
}else{
|
||||
obj=editFunction(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validatePersonName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkFunction(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:25%;height: 50%;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" id="inOutItemModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类型">
|
||||
<a-select placeholder="请选择类型" v-decorator="[ 'type', validatorRules.type]">
|
||||
<a-select-option value="收入">收入</a-select-option>
|
||||
<a-select-option value="支出">支出</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addInOutItem,editInOutItem,checkInOutItem } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "InOutItemModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validatePersonName}
|
||||
]},
|
||||
type:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择类型!' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'remark'))
|
||||
autoJumpNextInput('inOutItemModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addInOutItem(formData);
|
||||
}else{
|
||||
obj=editInOutItem(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validatePersonName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkInOutItem(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:25%;height: 50%;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" id="memberModal">
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="[ 'supplier', validatorRules.supplier]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人">
|
||||
<a-input placeholder="请输入联系人" v-decorator.trim="[ 'contacts' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
|
||||
<a-input placeholder="请输入手机号码" v-decorator.trim="[ 'telephone' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
|
||||
<a-input placeholder="请输入联系电话" v-decorator.trim="[ 'phoneNum' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
|
||||
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24/2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="[ 'description' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addSupplier,editSupplier,checkSupplier } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "MemberModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
supplier:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateSupplierName}
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'supplier', 'contacts', 'telephone', 'email', 'telephone',
|
||||
'phoneNum', 'description'))
|
||||
autoJumpNextInput('memberModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
if(this.model.beginNeedGet && this.model.beginNeedPay) {
|
||||
that.$message.warn("期初应收和期初应付不能同时输入");
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
formData.type = "会员";
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addSupplier(formData);
|
||||
}else{
|
||||
obj=editSupplier(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateSupplierName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
type: '会员',
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkSupplier(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:ok=false
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
:okButtonProps="{ props: {disabled: disableSubmit} }"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form" id="organizationModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator="['orgAbr', validatorRules.orgAbr ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
|
||||
<a-input placeholder="请输入编号" v-decorator="['orgNo', validatorRules.orgNo ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级机构">
|
||||
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
|
||||
allow-clear treeDefaultExpandAll="true"
|
||||
:treeData="departTree" v-model="model.parentId" placeholder="请选择上级机构">
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
||||
<a-input-number v-decorator="[ 'sort' ]"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="[ 'remark' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<!-- 注释了ANT组件 -->
|
||||
<script>
|
||||
import { httpAction } from '@/api/manage'
|
||||
import { queryOrganizationTreeList, checkOrganization } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import pick from 'lodash.pick'
|
||||
// import ATextarea from 'ant-design-vue/es/input/TextArea'
|
||||
export default {
|
||||
name: "OrganizationModal",
|
||||
// components: { ATextarea },
|
||||
data () {
|
||||
return {
|
||||
departTree:[],
|
||||
orgTypeData:[],
|
||||
phoneWarning:'',
|
||||
departName:"",
|
||||
title:"操作",
|
||||
visible: false,
|
||||
disableSubmit:false,
|
||||
model: {},
|
||||
menuhidden:false,
|
||||
menuusing:true,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
orgAbr: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!'},
|
||||
{ validator: this.validateName}
|
||||
]
|
||||
},
|
||||
orgNo: {rules: [{required: true, message: '请输入编码!'}]}
|
||||
},
|
||||
url: {
|
||||
add: "/organization/add",
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
loadTreeData(){
|
||||
var that = this;
|
||||
let params = {};
|
||||
params.id='';
|
||||
queryOrganizationTreeList(params).then((res)=>{
|
||||
if(res){
|
||||
that.departTree = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
let temp = res[i];
|
||||
that.departTree.push(temp);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
add () {
|
||||
this.edit();
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, {});
|
||||
this.visible = true;
|
||||
this.loadTreeData();
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(record, 'orgAbr', 'orgNo', 'parentId', 'sort', 'remark'))
|
||||
autoJumpNextInput('organizationModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.disableSubmit = false;
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
//时间格式化
|
||||
console.log(formData)
|
||||
httpAction(this.url.add,formData,"post").then((res)=>{
|
||||
if(res.code == 200){
|
||||
that.$message.success(res.msg);
|
||||
that.loadTreeData();
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkOrganization(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<a-modal
|
||||
title="重新设定密码"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
style="top:20px;"
|
||||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form" id="passwordModal">
|
||||
|
||||
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入用户账号" v-decorator="[ 'username', {}]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="登陆密码" :labelCol="labelCol" :wrapperCol="wrapperCol" hasFeedback >
|
||||
<a-input type="password" placeholder="请输入登陆密码" v-decorator="[ 'password', validatorRules.password]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" hasFeedback >
|
||||
<a-input type="password" @blur="handleConfirmBlur" placeholder="请重新输入登陆密码" v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>
|
||||
</a-form-item>
|
||||
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {changePassword} from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "PasswordModal",
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
confirmDirty: false,
|
||||
validatorRules:{
|
||||
password:{
|
||||
rules: [{
|
||||
required: true,
|
||||
pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
|
||||
message: '密码由8位数字、大小写字母和特殊符号组成!'
|
||||
}, {
|
||||
validator: this.validateToNextPassword,
|
||||
}],
|
||||
},
|
||||
confirmpassword:{
|
||||
rules: [{
|
||||
required: true, message: '请重新输入登陆密码!',
|
||||
}, {
|
||||
validator: this.compareToFirstPassword,
|
||||
}],
|
||||
},
|
||||
},
|
||||
|
||||
model: {},
|
||||
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
form:this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
console.log("created");
|
||||
},
|
||||
|
||||
methods: {
|
||||
show (username) {
|
||||
this.form.resetFields();
|
||||
this.visible = true;
|
||||
this.model.username = username;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({username:username});
|
||||
autoJumpNextInput('passwordModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
this.disableSubmit = false;
|
||||
this.selectedRole = [];
|
||||
},
|
||||
handleSubmit () {
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
changePassword(formData).then((res)=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message);
|
||||
this.$emit('ok');
|
||||
}else{
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false;
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateToNextPassword (rule, value, callback) {
|
||||
const form = this.form;
|
||||
const confirmpassword=form.getFieldValue('confirmpassword');
|
||||
console.log("confirmpassword==>",confirmpassword);
|
||||
if (value && confirmpassword && value !== confirmpassword) {
|
||||
callback('两次输入的密码不一样!');
|
||||
}
|
||||
if (value && this.confirmDirty) {
|
||||
form.validateFields(['confirm'], { force: true })
|
||||
}
|
||||
callback();
|
||||
},
|
||||
compareToFirstPassword (rule, value, callback) {
|
||||
const form = this.form;
|
||||
if (value && value !== form.getFieldValue('password')) {
|
||||
callback('两次输入的密码不一样!');
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
handleConfirmBlur (e) {
|
||||
const value = e.target.value
|
||||
this.confirmDirty = this.confirmDirty || !!value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:30%;height: 40%;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" id="personModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="姓名">
|
||||
<a-input placeholder="请输入姓名" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类型">
|
||||
<a-select placeholder="请选择类型" v-decorator="[ 'type', validatorRules.type]">
|
||||
<a-select-option value="业务员">业务员</a-select-option>
|
||||
<a-select-option value="仓管员">仓管员</a-select-option>
|
||||
<a-select-option value="财务员">财务员</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addPerson,editPerson,checkPerson } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "PersonModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入姓名!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validatePersonName}
|
||||
]},
|
||||
type:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择类型!' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
autoJumpNextInput('personModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addPerson(formData);
|
||||
}else{
|
||||
obj=editPerson(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validatePersonName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkPerson(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:30%;height: 40%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form" id="platformConfigModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="配置名称">
|
||||
<a-input placeholder="请输入配置名称" v-decorator.trim="[ 'platformKeyInfo' ]" :readOnly="true" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="配置值">
|
||||
<a-input placeholder="请输入配置值" v-decorator.trim="[ 'platformValue' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addPlatformConfig,editPlatformConfig } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "PlatformConfigModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'platformKeyInfo', 'platformValue'))
|
||||
autoJumpNextInput('platformConfigModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addPlatformConfig(formData);
|
||||
}else{
|
||||
obj=editPlatformConfig(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:25%;height: 50%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="机器码">
|
||||
<a-input v-decorator.trim="[ 'platformKey' ]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="激活码">
|
||||
<a-textarea :rows="2" placeholder="请输入激活码" v-decorator="[ 'platformValue' ]"/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {getPlatformConfigByKey } from '@/api/api'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
export default {
|
||||
name: "PluginModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
machineCode: '',
|
||||
activationCode: '',
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入姓名!' },
|
||||
]},
|
||||
type:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择类型!' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
edit () {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, {});
|
||||
getAction("/plugin/getMacWithSecret").then((res)=>{
|
||||
if(res && res.code == 200) {
|
||||
this.model.platformKey = res.data
|
||||
getPlatformConfigByKey( {"platformKey": "activation_code"}).then((res)=>{
|
||||
if(res && res.code == 200) {
|
||||
this.model.platformValue = res.data.platformValue
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'platformKey','platformValue'))
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
formData.platformKey = 'activation_code'
|
||||
postAction('/platformConfig/updatePlatformConfigByKey', formData).then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$message.info('填写成功!');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 95%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
|
||||
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
|
||||
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
|
||||
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
|
||||
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
|
||||
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
树操作 <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<a-col :md="10" :sm="24">
|
||||
<template>
|
||||
<a-tree
|
||||
checkable
|
||||
multiple
|
||||
@check="onCheck"
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="roleFunctionTree"
|
||||
:checkStrictly="checkStrictly"
|
||||
:expandedKeys="iExpandedKeys"
|
||||
:autoExpandParent="true"
|
||||
@expand="onExpand"/>
|
||||
</template>
|
||||
</a-col>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addUserBusiness,editUserBusiness,checkUserBusiness} from '@/api/api'
|
||||
import {getAction} from '@/api/manage'
|
||||
export default {
|
||||
name: "RoleFunctionModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
width: '800px',
|
||||
visible: false,
|
||||
model: {},
|
||||
roleId: 0,
|
||||
iExpandedKeys: [],
|
||||
roleFunctionTree: [],
|
||||
checkedKeys: [],
|
||||
selectedKeys: [],
|
||||
checkStrictly: false,
|
||||
hiding: true,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, {});
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
});
|
||||
this.roleId = record.id
|
||||
this.checkedKeys = []
|
||||
this.loadTree(record.id)
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
formData.type = 'RoleFunctions'
|
||||
formData.keyId = this.roleId
|
||||
formData.value = this.checkedKeys
|
||||
let obj;
|
||||
checkUserBusiness({'type': 'RoleFunctions','keyId': this.roleId}).then((res)=>{
|
||||
if(res.data && res.data.id) {
|
||||
formData.id=res.data.id
|
||||
obj=editUserBusiness(formData);
|
||||
} else {
|
||||
obj=addUserBusiness(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok', this.roleId);
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
loadTree(id) {
|
||||
let that = this
|
||||
that.treeData = []
|
||||
that.roleFunctionTree = []
|
||||
let params = {};
|
||||
params.id='';
|
||||
getAction('/function/findRoleFunction?UBType=RoleFunctions&UBKeyId='+id).then((res) => {
|
||||
if (res) {
|
||||
//机构全选后,再添加机构,选中数量增多
|
||||
this.allTreeKeys = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
let temp = res[i]
|
||||
that.treeData.push(temp)
|
||||
that.roleFunctionTree.push(temp)
|
||||
that.setThisExpandedKeys(temp)
|
||||
that.getAllKeys(temp);
|
||||
}
|
||||
console.log(JSON.stringify(this.checkedKeys))
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log('onCheck', checkedKeys, info)
|
||||
this.hiding = false
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = checkedKeys.checked;
|
||||
}else{
|
||||
this.checkedKeys = checkedKeys
|
||||
}
|
||||
},
|
||||
setThisExpandedKeys(node) {
|
||||
if(node.checked==true) {
|
||||
this.checkedKeys.push(node.key)
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
this.iExpandedKeys.push(node.key)
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.setThisExpandedKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
getAllKeys(node) {
|
||||
// console.log('node',node);
|
||||
this.allTreeKeys.push(node.key)
|
||||
if (node.children && node.children.length > 0) {
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.getAllKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
expandAll () {
|
||||
this.iExpandedKeys = this.allTreeKeys
|
||||
},
|
||||
closeAll () {
|
||||
this.iExpandedKeys = []
|
||||
},
|
||||
checkALL () {
|
||||
this.checkStriccheckStrictlytly = false
|
||||
this.checkedKeys = this.allTreeKeys
|
||||
},
|
||||
cancelCheckALL () {
|
||||
this.checkedKeys = []
|
||||
},
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
onExpand(expandedKeys) {
|
||||
console.log('onExpand', expandedKeys)
|
||||
this.iExpandedKeys = expandedKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:25%;height: 50%;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" id="roleModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="角色名称">
|
||||
<a-input placeholder="请输入角色名称" v-decorator.trim="[ 'name', validatorRules.name]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="数据类型">
|
||||
<a-tooltip title="1、全部数据-该角色对应的用户可以看到全部单据;2、本机构数据-该角色对应的用户可以看到自己所在机构的全部单据;
|
||||
3、个人数据-该角色对应的用户只可以看到自己的单据。单据是指采购入库、销售出库等">
|
||||
<a-select placeholder="请选择数据类型" v-decorator="[ 'type', validatorRules.type]">
|
||||
<a-select-option value="全部数据">全部数据</a-select-option>
|
||||
<a-select-option value="本机构数据">本机构数据</a-select-option>
|
||||
<a-select-option value="个人数据">个人数据</a-select-option>
|
||||
</a-select>
|
||||
</a-tooltip>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述">
|
||||
<a-textarea :rows="2" placeholder="请输入描述" v-decorator="[ 'description', validatorRules.description ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addRole,editRole,checkRole } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "RoleModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
name:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入角色名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateRoleName}
|
||||
]
|
||||
},
|
||||
type:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择数据类型!' }
|
||||
]
|
||||
},
|
||||
description:{
|
||||
rules: [
|
||||
{ min: 0, max: 126, message: '长度不超过 126 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
autoJumpNextInput('roleModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addRole(formData);
|
||||
}else{
|
||||
obj=editRole(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateRoleName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkRole(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 95%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 按钮区域 -->
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="24">
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-button @click="toggleChecked">
|
||||
{{ !checked ? '全选' : '全取消' }}
|
||||
</a-button>
|
||||
<a-button @click="editToggleChecked" style="margin-left: 8px">
|
||||
{{ !editChecked ? '全选-编辑' : '全取消-编辑' }}
|
||||
</a-button>
|
||||
<a-button @click="auditToggleChecked" style="margin-left: 8px">
|
||||
{{ !auditChecked ? '全选-审核' : '全取消-审核' }}
|
||||
</a-button>
|
||||
<a-button @click="unAuditToggleChecked" style="margin-left: 8px">
|
||||
{{ !unAuditChecked ? '全选-反审核' : '全取消-反审核' }}
|
||||
</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:pagination="false"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:loading="loading">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(1)>-1" value="1" :checked="record.btnStr?record.btnStr.indexOf(1)>-1:false" @change="onChange(record,'1')">编辑</a-checkbox>
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(2)>-1" value="2" :checked="record.btnStr?record.btnStr.indexOf(2)>-1:false" @change="onChange(record,'2')">审核</a-checkbox>
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(7)>-1" value="7" :checked="record.btnStr?record.btnStr.indexOf(7)>-1:false" @change="onChange(record,'7')">反审核</a-checkbox>
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(3)>-1" value="3" :checked="record.btnStr?record.btnStr.indexOf(3)>-1:false" @change="onChange(record,'3')">导入导出</a-checkbox>
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(4)>-1" value="4" :checked="record.btnStr?record.btnStr.indexOf(4)>-1:false" @change="onChange(record,'4')">启用禁用</a-checkbox>
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(5)>-1" value="5" :checked="record.btnStr?record.btnStr.indexOf(5)>-1:false" @change="onChange(record,'5')">打印</a-checkbox>
|
||||
<a-checkbox v-if="record.pushBtn.indexOf(6)>-1" value="6" :checked="record.btnStr?record.btnStr.indexOf(6)>-1:false" @change="onChange(record,'6')">作废</a-checkbox>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { updateBtnStrByRoleId } from '@/api/api'
|
||||
import { removeByVal } from "@/utils/util"
|
||||
export default {
|
||||
name: "RolePushBtnModal",
|
||||
mixins:[JeecgListMixin],
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
width: '800px',
|
||||
visible: false,
|
||||
model: {},
|
||||
checked: false,
|
||||
editChecked: false,
|
||||
auditChecked: false,
|
||||
unAuditChecked: false,
|
||||
disableMixinCreated: true,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
/* 数据源 */
|
||||
dataSource:[],
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
width:40,
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '按钮列表',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/function/findRoleFunctionsById"
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
edit (roleId) {
|
||||
this.form.resetFields();
|
||||
this.model.id = roleId
|
||||
this.visible = true;
|
||||
if(roleId) {
|
||||
getAction(this.url.list, { roleId: roleId }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.dataSource = res.data.rows;
|
||||
this.ipagination.total = res.data.total;
|
||||
}
|
||||
else if (res.code === 400) {
|
||||
this.dataSource = []
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
else if (res.code === 500) {
|
||||
this.$message.warning(res.data)
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let funArray = this.dataSource
|
||||
let bindArr = [];
|
||||
let btnStr = ''
|
||||
for(let item of funArray){
|
||||
if (item.btnStr !== undefined && item.btnStr !== "" && item.btnStr !== "null" && item.btnStr !== null) {
|
||||
let bindJSON = {};
|
||||
bindJSON.funId = item.id;
|
||||
bindJSON.btnStr = item.btnStr;
|
||||
bindArr.push(bindJSON);
|
||||
}
|
||||
}
|
||||
// if (bindArr.length) {
|
||||
// btnStr = JSON.stringify(bindArr);
|
||||
// }
|
||||
let obj=updateBtnStrByRoleId({roleId: this.model.id, btnStr: bindArr});
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
toggleChecked() {
|
||||
this.checked = !this.checked;
|
||||
let funArray = this.dataSource
|
||||
if(this.checked) {
|
||||
for(let item of funArray){
|
||||
item.btnStr = item.pushBtn
|
||||
}
|
||||
} else {
|
||||
for(let item of funArray){
|
||||
item.btnStr = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
editToggleChecked() {
|
||||
this.editChecked = !this.editChecked;
|
||||
let funArray = this.dataSource
|
||||
if(this.editChecked) {
|
||||
for(let item of funArray){
|
||||
item.btnStr = this.parseArrByParam(1, item.btnStr, 1)
|
||||
}
|
||||
} else {
|
||||
for(let item of funArray){
|
||||
item.btnStr = this.parseArrByParam(1, item.btnStr, 0)
|
||||
}
|
||||
}
|
||||
},
|
||||
auditToggleChecked() {
|
||||
this.auditChecked = !this.auditChecked;
|
||||
let funArray = this.dataSource
|
||||
if(this.auditChecked) {
|
||||
for(let item of funArray){
|
||||
item.btnStr = this.parseArrByParam(2, item.btnStr, 1)
|
||||
}
|
||||
} else {
|
||||
for(let item of funArray){
|
||||
item.btnStr = this.parseArrByParam(2, item.btnStr, 0)
|
||||
}
|
||||
}
|
||||
},
|
||||
unAuditToggleChecked() {
|
||||
this.unAuditChecked = !this.unAuditChecked;
|
||||
let funArray = this.dataSource
|
||||
if(this.unAuditChecked) {
|
||||
for(let item of funArray){
|
||||
item.btnStr = this.parseArrByParam(7, item.btnStr, 1)
|
||||
}
|
||||
} else {
|
||||
for(let item of funArray){
|
||||
item.btnStr = this.parseArrByParam(7, item.btnStr, 0)
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 格式转换,控制按钮的显示或隐藏
|
||||
* @param param
|
||||
* @param btnStr
|
||||
* @param type
|
||||
* @returns {string}
|
||||
*/
|
||||
parseArrByParam(param, btnStr, type) {
|
||||
if(type) {
|
||||
btnStr = btnStr + ','
|
||||
if(btnStr.indexOf(param + ',') === -1) {
|
||||
btnStr = btnStr + param + ','
|
||||
}
|
||||
} else {
|
||||
btnStr = btnStr + ','
|
||||
if(btnStr.indexOf(param + ',') > -1) {
|
||||
btnStr = btnStr.replace(param + ',', '')
|
||||
}
|
||||
}
|
||||
if(btnStr) {
|
||||
btnStr = btnStr.replace('null', '')
|
||||
btnStr = btnStr.substring(0, btnStr.length-1)
|
||||
if(btnStr.substring(0,1) === ',') {
|
||||
btnStr = btnStr.substring(1)
|
||||
}
|
||||
}
|
||||
return btnStr
|
||||
},
|
||||
onChange(record,value) {
|
||||
let funArray = this.dataSource
|
||||
for(let item of funArray){
|
||||
if(item.id === record.id) {
|
||||
let btnStr = record.btnStr
|
||||
if(btnStr) {
|
||||
let btnArr = btnStr.split(',')
|
||||
if(btnStr.indexOf(value)>-1) {
|
||||
//去掉勾选
|
||||
removeByVal(btnArr, value)
|
||||
item.btnStr = btnArr.join()
|
||||
} else {
|
||||
//勾选
|
||||
btnArr.push(value)
|
||||
item.btnStr = btnArr.join()
|
||||
}
|
||||
} else {
|
||||
let btnArr = []
|
||||
//勾选
|
||||
btnArr.push(value)
|
||||
item.btnStr = btnArr.join()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:20%;height: 60%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="登录名称">
|
||||
<a-input placeholder="请输入登录名称" v-decorator.trim="[ 'loginName', validatorRules.loginName]" :readOnly="!!model.id"
|
||||
suffix="初始密码:123456" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="用户数量限制">
|
||||
<a-input-number style="width:100%" placeholder="请输入用户数量限制" v-decorator.trim="[ 'userNumLimit' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="租户类型">
|
||||
<a-select style="width:100%" placeholder="请选择租户类型" v-decorator.trim="[ 'type' ]">
|
||||
<a-select-option value="0">免费租户</a-select-option>
|
||||
<a-select-option value="1">付费租户</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="到期时间">
|
||||
<j-date style="width:100%" placeholder="请选择到期时间" v-decorator.trim="[ 'expireTime' ]" :show-time="true"/>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述">
|
||||
<a-textarea :rows="2" placeholder="请输入描述" v-decorator.trim="[ 'remark' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {registerUser,editTenant,checkTenant } from '@/api/api'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import md5 from 'md5'
|
||||
export default {
|
||||
name: "TenantModal",
|
||||
components: {
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
loginName:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入登录名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateLoginName}
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.model.expireTime = this.model.expireTimeStr
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'loginName', 'userNumLimit', 'type', 'expireTime', 'remark'))
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
formData.password = md5('123456')
|
||||
obj=registerUser(formData);
|
||||
}else{
|
||||
obj=editTenant(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateLoginName(rule, value, callback){
|
||||
let params = {
|
||||
name: value,
|
||||
id: this.model.id?this.model.id:0
|
||||
};
|
||||
checkTenant(params).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
if(!res.data.status){
|
||||
callback();
|
||||
} else {
|
||||
callback("登录名称已经存在");
|
||||
}
|
||||
} else {
|
||||
callback(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="1000"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
>
|
||||
<template slot="footer">
|
||||
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
|
||||
关闭
|
||||
</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form" id="unitModal">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="基本单位">
|
||||
<a-input placeholder="请输入基本单位(小单位)" v-decorator.trim="[ 'basicUnit', validatorRules.basicUnit]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="副单位">
|
||||
<a-input placeholder="请输入副单位(大单位)" style="width:48%" v-decorator.trim="[ 'otherUnit' ]" />
|
||||
=
|
||||
<a-input suffix="基本单位" placeholder="请输入比例" style="width:48%" v-decorator.trim="[ 'ratio' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="副单位2">
|
||||
<a-input placeholder="请输入副单位2(大单位)" style="width:48%" v-decorator.trim="[ 'otherUnitTwo' ]" />
|
||||
=
|
||||
<a-input suffix="基本单位" placeholder="请输入比例2" style="width:48%" v-decorator.trim="[ 'ratioTwo' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="副单位3">
|
||||
<a-input placeholder="请输入副单位3(大单位)" style="width:48%" v-decorator.trim="[ 'otherUnitThree' ]" />
|
||||
=
|
||||
<a-input suffix="基本单位" placeholder="请输入比例3" style="width:48%" v-decorator.trim="[ 'ratioThree' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addUnit,editUnit,checkUnit } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
export default {
|
||||
name: "UnitModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
basicUnit:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入基本单位!' },
|
||||
{ min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' }
|
||||
]},
|
||||
otherUnit:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入副单位!' },
|
||||
{ min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' }
|
||||
]},
|
||||
ratio:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入比例!' },
|
||||
{ validator: this.validateRatio}
|
||||
]}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'basicUnit','otherUnit','ratio','otherUnitTwo','ratioTwo','otherUnitThree','ratioThree'))
|
||||
autoJumpNextInput('unitModal')
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
// if(!formData.otherUnit) {
|
||||
// that.$message.warning('抱歉,副单位不能为空!');
|
||||
// that.confirmLoading = false;
|
||||
// return;
|
||||
// }
|
||||
if(formData.otherUnit && !formData.ratio) {
|
||||
that.$message.warning('抱歉,比例不能为空!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
if(formData.otherUnitTwo && !formData.ratioTwo) {
|
||||
that.$message.warning('抱歉,比例2不能为空!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
if(formData.otherUnitThree && !formData.ratioThree) {
|
||||
that.$message.warning('抱歉,比例3不能为空!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
if(!formData.otherUnitTwo && formData.otherUnitThree) {
|
||||
that.$message.warning('抱歉,需要先输入副单位2再输入副单位3!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
if(formData.basicUnit === formData.otherUnit) {
|
||||
that.$message.warning('抱歉,基本单位与副单位不能相同!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
if(formData.basicUnit === formData.otherUnitTwo) {
|
||||
that.$message.warning('抱歉,基本单位与副单位2不能相同!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
if(formData.basicUnit === formData.otherUnitThree) {
|
||||
that.$message.warning('抱歉,基本单位与副单位3不能相同!');
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
obj=addUnit(formData);
|
||||
}else{
|
||||
obj=editUnit(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
validateRatio(rule, value, callback) {
|
||||
if (value > 1) {
|
||||
callback();
|
||||
} else {
|
||||
callback("比例必须大于1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 95%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
|
||||
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
|
||||
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
|
||||
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
|
||||
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
|
||||
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
树操作 <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<a-col :md="10" :sm="24">
|
||||
<template>
|
||||
<a-tree
|
||||
checkable
|
||||
multiple
|
||||
@check="onCheck"
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="roleFunctionTree"
|
||||
:checkStrictly="checkStrictly"
|
||||
:expandedKeys="iExpandedKeys"
|
||||
:autoExpandParent="true"
|
||||
@expand="onExpand"/>
|
||||
</template>
|
||||
</a-col>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addUserBusiness,editUserBusiness,checkUserBusiness} from '@/api/api'
|
||||
import {getAction} from '@/api/manage'
|
||||
export default {
|
||||
name: "UserCustomerModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
roleId: 0,
|
||||
iExpandedKeys: [],
|
||||
roleFunctionTree: [],
|
||||
checkedKeys: [],
|
||||
selectedKeys: [],
|
||||
checkStrictly: false,
|
||||
hiding: true,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, {});
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
});
|
||||
this.roleId = record.id
|
||||
this.checkedKeys = []
|
||||
this.loadTree(record.id)
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
formData.type = 'UserCustomer'
|
||||
formData.keyId = this.roleId
|
||||
formData.value = this.checkedKeys
|
||||
let obj;
|
||||
checkUserBusiness({'type': 'UserCustomer','keyId': this.roleId}).then((res)=>{
|
||||
if(res.data && res.data.id) {
|
||||
formData.id=res.data.id
|
||||
obj=editUserBusiness(formData);
|
||||
} else {
|
||||
obj=addUserBusiness(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
loadTree(id) {
|
||||
let that = this
|
||||
that.treeData = []
|
||||
that.roleFunctionTree = []
|
||||
let params = {};
|
||||
params.id='';
|
||||
getAction('/supplier/findUserCustomer?UBType=UserCustomer&UBKeyId='+id).then((res) => {
|
||||
if (res) {
|
||||
//机构全选后,再添加机构,选中数量增多
|
||||
this.allTreeKeys = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
let temp = res[i]
|
||||
that.treeData.push(temp)
|
||||
that.roleFunctionTree.push(temp)
|
||||
that.setThisExpandedKeys(temp)
|
||||
that.getAllKeys(temp);
|
||||
}
|
||||
console.log(JSON.stringify(this.checkedKeys))
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log('onCheck', checkedKeys, info)
|
||||
this.hiding = false
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = checkedKeys.checked;
|
||||
}else{
|
||||
this.checkedKeys = checkedKeys
|
||||
}
|
||||
},
|
||||
setThisExpandedKeys(node) {
|
||||
if(node.checked==true) {
|
||||
this.checkedKeys.push(node.key)
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
this.iExpandedKeys.push(node.key)
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.setThisExpandedKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
getAllKeys(node) {
|
||||
// console.log('node',node);
|
||||
this.allTreeKeys.push(node.key)
|
||||
if (node.children && node.children.length > 0) {
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.getAllKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
expandAll () {
|
||||
this.iExpandedKeys = this.allTreeKeys
|
||||
},
|
||||
closeAll () {
|
||||
this.iExpandedKeys = []
|
||||
},
|
||||
checkALL () {
|
||||
this.checkStriccheckStrictlytly = false
|
||||
this.checkedKeys = this.allTreeKeys
|
||||
},
|
||||
cancelCheckALL () {
|
||||
this.checkedKeys = []
|
||||
},
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
onExpand(expandedKeys) {
|
||||
console.log('onExpand', expandedKeys)
|
||||
this.iExpandedKeys = expandedKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 95%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
|
||||
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
|
||||
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
|
||||
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
|
||||
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
|
||||
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
树操作 <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<a-col :md="10" :sm="24">
|
||||
<template>
|
||||
<a-tree
|
||||
checkable
|
||||
multiple
|
||||
@check="onCheck"
|
||||
:selectedKeys="selectedKeys"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="roleFunctionTree"
|
||||
:checkStrictly="checkStrictly"
|
||||
:expandedKeys="iExpandedKeys"
|
||||
:autoExpandParent="true"
|
||||
@expand="onExpand"/>
|
||||
</template>
|
||||
</a-col>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {addUserBusiness,editUserBusiness,checkUserBusiness} from '@/api/api'
|
||||
import {getAction} from '@/api/manage'
|
||||
export default {
|
||||
name: "UserDepotModal",
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
roleId: 0,
|
||||
iExpandedKeys: [],
|
||||
roleFunctionTree: [],
|
||||
checkedKeys: [],
|
||||
selectedKeys: [],
|
||||
checkStrictly: false,
|
||||
hiding: true,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, {});
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name', 'type', 'description'))
|
||||
});
|
||||
this.roleId = record.id
|
||||
this.checkedKeys = []
|
||||
this.loadTree(record.id)
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
formData.type = 'UserDepot'
|
||||
formData.keyId = this.roleId
|
||||
formData.value = this.checkedKeys
|
||||
let obj;
|
||||
checkUserBusiness({'type': 'UserDepot','keyId': this.roleId}).then((res)=>{
|
||||
if(res.data && res.data.id) {
|
||||
formData.id=res.data.id
|
||||
obj=editUserBusiness(formData);
|
||||
} else {
|
||||
obj=addUserBusiness(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
loadTree(id) {
|
||||
let that = this
|
||||
that.treeData = []
|
||||
that.roleFunctionTree = []
|
||||
let params = {};
|
||||
params.id='';
|
||||
getAction('/depot/findUserDepot?UBType=UserDepot&UBKeyId='+id).then((res) => {
|
||||
if (res) {
|
||||
//机构全选后,再添加机构,选中数量增多
|
||||
this.allTreeKeys = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
let temp = res[i]
|
||||
that.treeData.push(temp)
|
||||
that.roleFunctionTree.push(temp)
|
||||
that.setThisExpandedKeys(temp)
|
||||
that.getAllKeys(temp);
|
||||
}
|
||||
console.log(JSON.stringify(this.checkedKeys))
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onCheck(checkedKeys, info) {
|
||||
console.log('onCheck', checkedKeys, info)
|
||||
this.hiding = false
|
||||
if(this.checkStrictly){
|
||||
this.checkedKeys = checkedKeys.checked;
|
||||
}else{
|
||||
this.checkedKeys = checkedKeys
|
||||
}
|
||||
},
|
||||
setThisExpandedKeys(node) {
|
||||
if(node.checked==true) {
|
||||
this.checkedKeys.push(node.key)
|
||||
}
|
||||
if (node.children && node.children.length > 0) {
|
||||
this.iExpandedKeys.push(node.key)
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.setThisExpandedKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
getAllKeys(node) {
|
||||
// console.log('node',node);
|
||||
this.allTreeKeys.push(node.key)
|
||||
if (node.children && node.children.length > 0) {
|
||||
for (let a = 0; a < node.children.length; a++) {
|
||||
this.getAllKeys(node.children[a])
|
||||
}
|
||||
}
|
||||
},
|
||||
expandAll () {
|
||||
this.iExpandedKeys = this.allTreeKeys
|
||||
},
|
||||
closeAll () {
|
||||
this.iExpandedKeys = []
|
||||
},
|
||||
checkALL () {
|
||||
this.checkStriccheckStrictlytly = false
|
||||
this.checkedKeys = this.allTreeKeys
|
||||
},
|
||||
cancelCheckALL () {
|
||||
this.checkedKeys = []
|
||||
},
|
||||
switchCheckStrictly (v) {
|
||||
if(v==1){
|
||||
this.checkStrictly = false
|
||||
}else if(v==2){
|
||||
this.checkStrictly = true
|
||||
}
|
||||
},
|
||||
onExpand(expandedKeys) {
|
||||
console.log('onExpand', expandedKeys)
|
||||
this.iExpandedKeys = expandedKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:10%;height: 85%;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" id="userModal">
|
||||
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入登录名称" v-decorator.trim="[ 'loginName', validatorRules.loginName]" :readOnly="!!model.id"
|
||||
suffix="初始密码:123456" />
|
||||
</a-form-item>
|
||||
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||
<a-input placeholder="请输入用户姓名" v-decorator.trim="[ 'username', validatorRules.username]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="角色">
|
||||
<a-select v-if="model.roleName!='租户'" placeholder="选择角色" v-decorator="[ 'roleId', validatorRules.roleId]" :dropdownMatchSelectWidth="false">
|
||||
<a-select-option v-for="(item,index) in roleList" :key="index" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-col v-if="model.roleName=='租户'"><a-row>租户</a-row></a-col>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="机构">
|
||||
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" allow-clear
|
||||
:treeData="orgaTree" v-decorator="[ 'orgaId' ]" placeholder="请选择机构">
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="职位">
|
||||
<a-input placeholder="请输入职位" v-decorator.trim="[ 'position' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电话号码">
|
||||
<a-input placeholder="请输入电话号码" v-decorator.trim="[ 'phonenum' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
|
||||
<a-input placeholder="请输入电子邮箱" v-decorator.trim="[ 'email' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
||||
<a-input placeholder="请输入排序" v-decorator.trim="[ 'userBlngOrgaDsplSeq' ]" />
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="描述">
|
||||
<a-textarea :rows="2" placeholder="请输入描述" v-decorator="[ 'description' ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import Vue from 'vue'
|
||||
import JSelectPosition from '@/components/jeecgbiz/JSelectPosition'
|
||||
import { getAction } from '@/api/manage'
|
||||
import {addUser,editUser,queryOrganizationTreeList,roleAllList} from '@/api/api'
|
||||
import {duplicateCheck } from '@/api/api'
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
export default {
|
||||
name: "UserModal",
|
||||
components: {
|
||||
JImageUpload,
|
||||
JSelectPosition
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
modalWidth:800,
|
||||
drawerWidth:700,
|
||||
orgaTree: [],
|
||||
roleList: [],
|
||||
userId:"", //保存用户id
|
||||
isReadOnly: false,
|
||||
disableSubmit:false,
|
||||
dateFormat:"YYYY-MM-DD",
|
||||
validatorRules:{
|
||||
loginName:{
|
||||
rules: [{
|
||||
required: true, message: '请输入登录名称!'
|
||||
}]
|
||||
},
|
||||
username:{
|
||||
rules: [{
|
||||
required: true, message: '请输入用户姓名!'
|
||||
}]
|
||||
},
|
||||
roleId:{
|
||||
rules: [{
|
||||
required: true, message: '请选择角色!'
|
||||
}]
|
||||
}
|
||||
},
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
uploadLoading:false,
|
||||
confirmLoading: false,
|
||||
headers:{},
|
||||
form:this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.headers = {"X-Access-Token":""}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.loadOrgaData()
|
||||
this.loadRoleData()
|
||||
this.form.resetFields();
|
||||
this.userId = record.id;
|
||||
this.visible = true;
|
||||
this.model = Object.assign({}, record);
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'loginName','username','roleId','orgaId','position',
|
||||
'phonenum','email','userBlngOrgaDsplSeq','description'))
|
||||
autoJumpNextInput('userModal')
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
this.disableSubmit = false;
|
||||
},
|
||||
handleOk() {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
formData.id = this.userId;
|
||||
obj=addUser(formData);
|
||||
}else{
|
||||
obj=editUser(formData);
|
||||
}
|
||||
obj.then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.msg);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
loadOrgaData(){
|
||||
let that = this;
|
||||
let params = {};
|
||||
params.id='';
|
||||
queryOrganizationTreeList(params).then((res)=>{
|
||||
if(res){
|
||||
that.orgaTree = res
|
||||
}
|
||||
})
|
||||
},
|
||||
loadRoleData(){
|
||||
roleAllList({}).then((res)=>{
|
||||
if(res){
|
||||
this.roleList = res
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:height="650"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top: 15%; height: 70%; overflow-y: hidden"
|
||||
>
|
||||
<template slot="footer">
|
||||
<a-button key="back" v-if="isReadOnly" @click="handleCancel"> 关闭 </a-button>
|
||||
</template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-tabs default-active-key="1" v-model="activeKey">
|
||||
<a-tab-pane key="1" tab="外部">
|
||||
<a-form :form="form" id="vendorModal" v-if="activeKey == 1">
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
|
||||
<a-input placeholder="请输入名称" v-decorator.trim="['supplier', validatorRules.supplier]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人">
|
||||
<a-input placeholder="请输入联系人" v-decorator.trim="['contacts']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
|
||||
<a-input placeholder="请输入手机号码" v-decorator.trim="['telephone']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
|
||||
<a-input placeholder="请输入联系电话" v-decorator.trim="['phoneNum']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电子邮箱">
|
||||
<a-input placeholder="请输入电子邮箱" v-decorator.trim="['email']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="传真">
|
||||
<a-input placeholder="请输入传真" v-decorator.trim="['fax']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期初应付">
|
||||
<a-input placeholder="请输入期初应付" v-decorator.trim="['beginNeedPay']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期末应付">
|
||||
<a-input v-decorator.trim="['allNeedPay']" :readOnly="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纳税人识别号">
|
||||
<a-input placeholder="请输入纳税人识别号" v-decorator.trim="['taxNum']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="税率(%)">
|
||||
<a-input placeholder="请输入税率(%)" v-decorator.trim="['taxRate']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="开户行">
|
||||
<a-input placeholder="请输入开户行" v-decorator.trim="['bankName']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="账号">
|
||||
<a-input placeholder="请输入账号" v-decorator.trim="['accountNumber']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="地址">
|
||||
<a-input placeholder="请输入地址" v-decorator.trim="['address']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator.trim="['description']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-form>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="内部" force-render>
|
||||
<a-form :form="form" id="vendorModal" v-if="activeKey == 2">
|
||||
<a-col :span="24 / 2">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="租户">
|
||||
<a-select default-value="lucy" placeholder="请选择租户" style="width: 120px" v-decorator.trim="['tenant']">
|
||||
<a-select-option v-for="item in tenantList" :value="item.id" :key="item.id"> {{item.loginName}} </a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-form>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { addSupplier, editSupplier, checkSupplier, getAlltenantInfo } from '@/api/api'
|
||||
import { autoJumpNextInput } from '@/utils/util'
|
||||
export default {
|
||||
name: 'VendorModal',
|
||||
data() {
|
||||
return {
|
||||
title: '操作',
|
||||
visible: false,
|
||||
model: {},
|
||||
isReadOnly: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules: {
|
||||
supplier: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入名称!' },
|
||||
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateSupplierName },
|
||||
],
|
||||
},
|
||||
},
|
||||
tenantList: [],
|
||||
activeKey: '1'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getAlltenantInfo()
|
||||
},
|
||||
methods: {
|
||||
//获取所有的租户信息
|
||||
async getAlltenantInfo() {
|
||||
let res = await getAlltenantInfo()
|
||||
if(res.code == 200) {
|
||||
this.tenantList = res.data
|
||||
}
|
||||
},
|
||||
add() {
|
||||
this.edit({})
|
||||
},
|
||||
edit(record) {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(
|
||||
pick(
|
||||
this.model,
|
||||
'supplier',
|
||||
'contacts',
|
||||
'telephone',
|
||||
'email',
|
||||
'telephone',
|
||||
'phoneNum',
|
||||
'fax',
|
||||
'beginNeedGet',
|
||||
'beginNeedPay',
|
||||
'allNeedGet',
|
||||
'allNeedPay',
|
||||
'taxNum',
|
||||
'taxRate',
|
||||
'bankName',
|
||||
'accountNumber',
|
||||
'address',
|
||||
'description'
|
||||
)
|
||||
)
|
||||
autoJumpNextInput('vendorModal')
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
},
|
||||
handleOk() {
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let formData = Object.assign(this.model, values)
|
||||
formData.type = '供应商'
|
||||
let obj
|
||||
if (!this.model.id) {
|
||||
obj = addSupplier(formData)
|
||||
} else {
|
||||
obj = editSupplier(formData)
|
||||
}
|
||||
obj
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
that.$emit('ok')
|
||||
} else {
|
||||
that.$message.warning(res.msg)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
that.confirmLoading = false
|
||||
that.close()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
validateSupplierName(rule, value, callback) {
|
||||
let params = {
|
||||
name: value,
|
||||
type: '供应商',
|
||||
id: this.model.id ? this.model.id : 0,
|
||||
}
|
||||
checkSupplier(params).then((res) => {
|
||||
if (res && res.code === 200) {
|
||||
if (!res.data.status) {
|
||||
callback()
|
||||
} else {
|
||||
callback('名称已经存在')
|
||||
}
|
||||
} else {
|
||||
callback(res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,35 @@
|
||||
@active-color: #4a4a48;
|
||||
ul {
|
||||
max-height: 700px;
|
||||
overflow-y: auto;
|
||||
padding-left: .5rem;
|
||||
i {
|
||||
font-size: 1.5rem;
|
||||
border: 1px solid #f1f1f1;
|
||||
padding: .2rem;
|
||||
margin: .3rem;
|
||||
cursor: pointer;
|
||||
&.active, &:hover {
|
||||
border-radius: 2px;
|
||||
border-color: @active-color;
|
||||
background-color: @active-color;
|
||||
color: #fff;
|
||||
transition: all .3s;
|
||||
}
|
||||
}
|
||||
li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
width: 5%;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #555;
|
||||
transition: color .3s ease-in-out,background-color .3s ease-in-out;
|
||||
position: relative;
|
||||
margin: 3px 0;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
padding: 10px 0 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<a-modal
|
||||
v-model="show"
|
||||
:width="900"
|
||||
:keyboard="false"
|
||||
:closable="false"
|
||||
:centered="true"
|
||||
@ok="ok"
|
||||
@cancel="cancel"
|
||||
:maskClosable="false"
|
||||
:mask="false"
|
||||
okText="确认"
|
||||
cancelText="取消">
|
||||
<a-tabs>
|
||||
<a-tab-pane tab="方向性图标" key="1">
|
||||
<ul>
|
||||
<li v-for="icon in icons.directionIcons" :key="icon">
|
||||
<a-icon :type="icon" :title="icon" @click="chooseIcon(icon)" :class="{'active':activeIndex === icon}"/>
|
||||
</li>
|
||||
</ul>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="指示性图标" key="2">
|
||||
<ul>
|
||||
<li v-for="icon in icons.suggestionIcons" :key="icon">
|
||||
<a-icon :type="icon" :title="icon" @click="chooseIcon(icon)" :class="{'active':activeIndex === icon}"/>
|
||||
</li>
|
||||
</ul>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="编辑类图标" key="3">
|
||||
<ul>
|
||||
<li v-for="icon in icons.editIcons" :key="icon">
|
||||
<a-icon :type="icon" :title="icon" @click="chooseIcon(icon)" :class="{'active':activeIndex === icon}"/>
|
||||
</li>
|
||||
</ul>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="数据类图标" key="4">
|
||||
<ul>
|
||||
<li v-for="icon in icons.dataIcons" :key="icon">
|
||||
<a-icon :type="icon" :title="icon" @click="chooseIcon(icon)" :class="{'active':activeIndex === icon}"/>
|
||||
</li>
|
||||
</ul>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="网站通用图标" key="5">
|
||||
<ul>
|
||||
<li v-for="icon in icons.webIcons" :key="icon">
|
||||
<a-icon :type="icon" :title="icon" @click="chooseIcon(icon)" :class="{'active':activeIndex === icon}"/>
|
||||
</li>
|
||||
</ul>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="品牌和标识" key="6">
|
||||
<ul>
|
||||
<li v-for="icon in icons.logoIcons" :key="icon">
|
||||
<a-icon :type="icon" :title="icon" @click="chooseIcon(icon)" :class="{'active':activeIndex === icon}"/>
|
||||
</li>
|
||||
</ul>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script>
|
||||
const directionIcons = ['step-backward', 'step-forward', 'fast-backward', 'fast-forward', 'shrink', 'arrows-alt', 'down', 'up', 'left', 'right', 'caret-up', 'caret-down', 'caret-left', 'caret-right', 'up-circle', 'down-circle', 'left-circle', 'right-circle', 'up-circle-o', 'down-circle-o', 'right-circle-o', 'left-circle-o', 'double-right', 'double-left', 'vertical-left', 'vertical-right', 'forward', 'backward', 'rollback', 'enter', 'retweet', 'swap', 'swap-left', 'swap-right', 'arrow-up', 'arrow-down', 'arrow-left', 'arrow-right', 'play-circle', 'play-circle-o', 'up-square', 'down-square', 'left-square', 'right-square', 'up-square-o', 'down-square-o', 'left-square-o', 'right-square-o', 'login', 'logout', 'menu-fold', 'menu-unfold', 'border-bottom', 'border-horizontal', 'border-inner', 'border-left', 'border-right', 'border-top', 'border-verticle', 'pic-center', 'pic-left', 'pic-right', 'radius-bottomleft', 'radius-bottomright', 'radius-upleft', 'radius-upright', 'fullscreen', 'fullscreen-exit']
|
||||
const suggestionIcons = ['question', 'question-circle', 'plus', 'plus-circle', 'pause', 'pause-circle', 'minus', 'minus-circle', 'plus-square', 'minus-square', 'info', 'info-circle', 'exclamation', 'exclamation-circle', 'close', 'close-circle', 'close-square', 'check', 'check-circle', 'check-square', 'clock-circle', 'warning', 'issues-close', 'stop']
|
||||
const editIcons = ['edit', 'form', 'copy', 'scissor', 'delete', 'snippets', 'diff', 'highlight', 'align-center', 'align-left', 'align-right', 'bg-colors', 'bold', 'italic', 'underline', 'strikethrough', 'redo', 'undo', 'zoom-in', 'zoom-out', 'font-colors', 'font-size', 'line-height', 'colum-height', 'dash', 'small-dash', 'sort-ascending', 'sort-descending', 'drag', 'ordered-list', 'radius-setting']
|
||||
const dataIcons = ['area-chart', 'pie-chart', 'bar-chart', 'dot-chart', 'line-chart', 'radar-chart', 'heat-map', 'fall', 'rise', 'stock', 'box-plot', 'fund', 'sliders']
|
||||
const webIcons = ['lock', 'unlock', 'bars', 'book', 'calendar', 'cloud', 'cloud-download', 'code', 'copy', 'credit-card', 'delete', 'desktop', 'download', 'ellipsis', 'file', 'file-text', 'file-unknown', 'file-pdf', 'file-word', 'file-excel', 'file-jpg', 'file-ppt', 'file-markdown', 'file-add', 'folder', 'folder-open', 'folder-add', 'hdd', 'frown', 'meh', 'smile', 'inbox', 'laptop', 'appstore', 'link', 'mail', 'mobile', 'notification', 'paper-clip', 'picture', 'poweroff', 'reload', 'search', 'setting', 'share-alt', 'shopping-cart', 'tablet', 'tag', 'tags', 'to-top', 'upload', 'user', 'video-camera', 'home', 'loading', 'loading-3-quarters', 'cloud-upload', 'star', 'heart', 'environment', 'eye', 'camera', 'save', 'team', 'solution', 'phone', 'filter', 'exception', 'export', 'customer-service', 'qrcode', 'scan', 'like', 'dislike', 'message', 'pay-circle', 'calculator', 'pushpin', 'bulb', 'select', 'switcher', 'rocket', 'bell', 'disconnect', 'database', 'compass', 'barcode', 'hourglass', 'key', 'flag', 'layout', 'printer', 'sound', 'usb', 'skin', 'tool', 'sync', 'wifi', 'car', 'schedule', 'user-add', 'user-delete', 'usergroup-add', 'usergroup-delete', 'man', 'woman', 'shop', 'gift', 'idcard', 'medicine-box', 'red-envelope', 'coffee', 'copyright', 'trademark', 'safety', 'wallet', 'bank', 'trophy', 'contacts', 'global', 'shake', 'api', 'fork', 'dashboard', 'table', 'profile', 'alert', 'audit', 'branches', 'build', 'border', 'crown', 'experiment', 'fire', 'money-collect', 'property-safety', 'read', 'reconciliation', 'rest', 'security-scan', 'insurance', 'interation', 'safety-certificate', 'project', 'thunderbolt', 'block', 'cluster', 'deployment-unit', 'dollar', 'euro', 'pound', 'file-done', 'file-exclamation', 'file-protect', 'file-search', 'file-sync', 'gateway', 'gold', 'robot', 'shopping']
|
||||
const logoIcons = ['android', 'apple', 'windows', 'ie', 'chrome', 'github', 'aliwangwang', 'dingding', 'weibo-square', 'weibo-circle', 'taobao-circle', 'html5', 'weibo', 'twitter', 'wechat', 'youtube', 'alipay-circle', 'taobao', 'skype', 'qq', 'medium-workmark', 'gitlab', 'medium', 'linkedin', 'google-plus', 'dropbox', 'facebook', 'codepen', 'amazon', 'google', 'codepen-circle', 'alipay', 'ant-design', 'aliyun', 'zhihu', 'slack', 'slack-square', 'behance', 'behance-square', 'dribbble', 'dribbble-square', 'instagram', 'yuque', 'alibaba', 'yahoo']
|
||||
export default {
|
||||
name: 'Icons',
|
||||
props: {
|
||||
iconChooseVisible: {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
icons: {
|
||||
directionIcons,
|
||||
suggestionIcons,
|
||||
editIcons,
|
||||
dataIcons,
|
||||
webIcons,
|
||||
logoIcons
|
||||
},
|
||||
choosedIcon: '',
|
||||
activeIndex: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show: {
|
||||
get: function () {
|
||||
return this.iconChooseVisible
|
||||
},
|
||||
set: function () {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset () {
|
||||
this.activeIndex = ''
|
||||
},
|
||||
chooseIcon (icon) {
|
||||
this.activeIndex = icon
|
||||
this.choosedIcon = icon
|
||||
this.$message.success(`选中 ${icon}`)
|
||||
},
|
||||
ok () {
|
||||
if (this.choosedIcon === '') {
|
||||
this.$message.warning('尚未选择任何图标')
|
||||
return
|
||||
}
|
||||
this.reset()
|
||||
this.$emit('choose', this.choosedIcon)
|
||||
},
|
||||
cancel () {
|
||||
this.reset()
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@import "Icon";
|
||||
</style>
|
||||
Reference in New Issue
Block a user