|
|
|
@ -1,116 +1,135 @@
|
|
|
|
|
<template>
|
|
|
|
|
<a-modal
|
|
|
|
|
title="应用编辑"
|
|
|
|
|
:width="900"
|
|
|
|
|
:visible="visible"
|
|
|
|
|
:confirmLoading="confirmLoading"
|
|
|
|
|
@ok="handleSubmit"
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
>
|
|
|
|
|
<a-modal title="服务项目编辑" :width="900" :visible="visible" @cancel="handleCancel" :confirmLoading="confirmLoading">
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
|
|
<a-form :form="form" >
|
|
|
|
|
<a-form-item
|
|
|
|
|
style="display: none;"
|
|
|
|
|
:labelCol="labelCol"
|
|
|
|
|
:wrapperCol="wrapperCol"
|
|
|
|
|
>
|
|
|
|
|
<a-input v-decorator="['id']" />
|
|
|
|
|
<a-form :form="form">
|
|
|
|
|
<a-form-item label="服务项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="服务项目名称"
|
|
|
|
|
v-decorator="['serviceProjectName', { rules: [{ required: true, message: '请输入服务项目名称!' }] }]" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
|
style="display: none;"
|
|
|
|
|
:labelCol="labelCol"
|
|
|
|
|
:wrapperCol="wrapperCol"
|
|
|
|
|
>
|
|
|
|
|
<a-input v-decorator="['active']" />
|
|
|
|
|
<a-form-item label="服务项目代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="服务项目代码"
|
|
|
|
|
v-decorator="['serviceProjectCode', { rules: [{ required: true, message: '请输入服务项目代码!' }] }]" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
|
label="应用名称"
|
|
|
|
|
:labelCol="labelCol"
|
|
|
|
|
:wrapperCol="wrapperCol"
|
|
|
|
|
has-feedback
|
|
|
|
|
>
|
|
|
|
|
<a-input placeholder="请输入应用名称" v-decorator="['name', {rules: [{required: true, message: '请输入应用名称!'}]}]" />
|
|
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
|
|
|
|
<a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sortNo']" :min="1" :max="1000" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
|
label="唯一编码"
|
|
|
|
|
:labelCol="labelCol"
|
|
|
|
|
:wrapperCol="wrapperCol"
|
|
|
|
|
has-feedback
|
|
|
|
|
>
|
|
|
|
|
<a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
|
:labelCol="labelCol"
|
|
|
|
|
:wrapperCol="wrapperCol"
|
|
|
|
|
label="排序"
|
|
|
|
|
>
|
|
|
|
|
<a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
|
|
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="服务项目说明">
|
|
|
|
|
<a-textarea
|
|
|
|
|
placeholder="服务项目说明"
|
|
|
|
|
v-decorator="['serviceProjectNote', { rules: [{ required: true, message: '请输入服务项目说明!' }] }]"
|
|
|
|
|
:rows="4" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-spin>
|
|
|
|
|
<template slot="footer">
|
|
|
|
|
<a-button @click="handleCancel">
|
|
|
|
|
关闭
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="handleCancel" type="danger">
|
|
|
|
|
删除
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="handleCancel" >
|
|
|
|
|
取消启用
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="handleCancel" type="primary">
|
|
|
|
|
启用
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="handleSubmit" type="primary">
|
|
|
|
|
保存
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button @click="handleSubmitEnable" type="primary">
|
|
|
|
|
保存并启用
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { sysAppEdit } from '@/api/modular/system/appManage'
|
|
|
|
|
export default {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 5 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 15 }
|
|
|
|
|
},
|
|
|
|
|
visible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
visibleDef: false,
|
|
|
|
|
form: this.$form.createForm(this)
|
|
|
|
|
}
|
|
|
|
|
import { ServiceProjectSavAndEnable, ServiceProjectSave } from '@/api/modular/system/appManage'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 5 }
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 15 }
|
|
|
|
|
},
|
|
|
|
|
pkId:"",
|
|
|
|
|
visible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
form: this.$form.createForm(this)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 初始化方法
|
|
|
|
|
edit(record) {
|
|
|
|
|
this.visible = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.form.setFieldsValue(
|
|
|
|
|
{
|
|
|
|
|
serviceProjectCode: record.serviceProjectCode,
|
|
|
|
|
serviceProjectName: record.serviceProjectName,
|
|
|
|
|
sortNo: record.sortNo,
|
|
|
|
|
serviceProjectNote: record.serviceProjectNote
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
this.pkId = record.pkId
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 初始化方法
|
|
|
|
|
edit (record) {
|
|
|
|
|
this.visible = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.form.setFieldsValue(
|
|
|
|
|
{
|
|
|
|
|
id: record.id,
|
|
|
|
|
name: record.name,
|
|
|
|
|
code: record.code,
|
|
|
|
|
sort: record.sort,
|
|
|
|
|
active: record.active
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
const { form: { validateFields } } = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
values.pkId = this.pkId
|
|
|
|
|
ServiceProjectSave(values).then((res) => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('新增失败:' + res.data.msg)
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
handleSubmit () {
|
|
|
|
|
const { form: { validateFields } } = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
sysAppEdit(values).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
|
this.visible = false
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('编辑失败:' + res.message)
|
|
|
|
|
}
|
|
|
|
|
}).finally((res) => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
}).finally((res) => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleCancel () {
|
|
|
|
|
this.form.resetFields()
|
|
|
|
|
this.visible = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleSubmitEnable() {
|
|
|
|
|
const { form: { validateFields } } = this
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
|
values.pkId = this.pkId
|
|
|
|
|
ServiceProjectSavAndEnable(values).then((res) => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
if (res.data.succ) {
|
|
|
|
|
this.$message.success('新增成功')
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('新增失败:' + res.data.msg)
|
|
|
|
|
}
|
|
|
|
|
}).finally((res) => {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleCancel() {
|
|
|
|
|
this.form.resetFields()
|
|
|
|
|
this.visible = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|