增加进销存
This commit is contained in:
@@ -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