|
|
@@ -0,0 +1,160 @@
|
|
|
+<template>
|
|
|
+ <a-spin :spinning="confirmLoading">
|
|
|
+ <j-form-container :disabled="formDisabled">
|
|
|
+ <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="关联租户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenantId">
|
|
|
+ <a-input v-model="model.tenantId" placeholder="请输入关联租户" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="关联酒店" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hotelId">
|
|
|
+ <a-input v-model="model.hotelId" placeholder="请输入关联酒店" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="工号,唯一键" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNo">
|
|
|
+ <a-input v-model="model.workNo" placeholder="请输入工号,唯一键" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
|
|
|
+ <a-input v-model="model.name" placeholder="请输入姓名" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="关联操作用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatorId">
|
|
|
+ <a-input v-model="model.operatorId" placeholder="请输入关联操作用户" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mobile">
|
|
|
+ <a-input v-model="model.mobile" placeholder="请输入联系电话" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
|
|
|
+ <a-input v-model="model.phone" placeholder="请输入手机号" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
|
|
|
+ <a-input v-model="model.address" placeholder="请输入地址" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="状态(0-禁用;1-启用)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
|
|
|
+ <a-input-number v-model="model.status" placeholder="请输入状态(0-禁用;1-启用)" style="width: 100%" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="备注信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remarks">
|
|
|
+ <a-input v-model="model.remarks" placeholder="请输入备注信息" ></a-input>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-model-item label="删除状态(0-正常,1-已删除)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
|
|
|
+ <a-input-number v-model="model.delFlag" placeholder="请输入删除状态(0-正常,1-已删除)" style="width: 100%" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form-model>
|
|
|
+ </j-form-container>
|
|
|
+ </a-spin>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+ import { httpAction, getAction } from '@/api/manage'
|
|
|
+ import { validateDuplicateValue } from '@/utils/util'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'BusSalesPersonForm',
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ //表单禁用
|
|
|
+ disabled: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ required: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ model:{
|
|
|
+ },
|
|
|
+ labelCol: {
|
|
|
+ xs: { span: 24 },
|
|
|
+ sm: { span: 5 },
|
|
|
+ },
|
|
|
+ wrapperCol: {
|
|
|
+ xs: { span: 24 },
|
|
|
+ sm: { span: 16 },
|
|
|
+ },
|
|
|
+ confirmLoading: false,
|
|
|
+ validatorRules: {
|
|
|
+ tenantId: [
|
|
|
+ { required: true, message: '请输入关联租户!'},
|
|
|
+ ],
|
|
|
+ hotelId: [
|
|
|
+ { required: true, message: '请输入关联酒店!'},
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ url: {
|
|
|
+ add: "/business/busSalesPerson/add",
|
|
|
+ edit: "/business/busSalesPerson/edit",
|
|
|
+ queryById: "/business/busSalesPerson/queryById"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ formDisabled(){
|
|
|
+ return this.disabled
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ //备份model原始值
|
|
|
+ this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ add () {
|
|
|
+ this.edit(this.modelDefault);
|
|
|
+ },
|
|
|
+ edit (record) {
|
|
|
+ this.model = Object.assign({}, record);
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ submitForm () {
|
|
|
+ const that = this;
|
|
|
+ // 触发表单验证
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ that.confirmLoading = true;
|
|
|
+ let httpurl = '';
|
|
|
+ let method = '';
|
|
|
+ if(!this.model.id){
|
|
|
+ httpurl+=this.url.add;
|
|
|
+ method = 'post';
|
|
|
+ }else{
|
|
|
+ httpurl+=this.url.edit;
|
|
|
+ method = 'put';
|
|
|
+ }
|
|
|
+ httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
+ if(res.success){
|
|
|
+ that.$message.success(res.message);
|
|
|
+ that.$emit('ok');
|
|
|
+ }else{
|
|
|
+ that.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ that.confirmLoading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|