19cd364f by renchao@pashanhoo.com

style:企业信息备案

1 parent efbef7b0
......@@ -20,7 +20,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="证件种类" prop="zjzl">
<el-form-item label="证件种类:" prop="zjzl">
<el-select
clearable
v-model="ruleForm.zjzl"
......@@ -37,7 +37,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="证件号:" prop="zjh">
<el-input v-model="ruleForm.zjh"></el-input>
<el-input v-model="ruleForm.zjh" maxlength="18"></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -50,13 +50,13 @@
</el-col>
<el-col :span="12">
<el-form-item label="法人电话:" prop="frdh">
<el-input v-model="ruleForm.frdh"></el-input>
<el-input v-model="ruleForm.frdh" maxlength="11"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="单位地址:">
<el-form-item label="单位地址:" prop="dwdz">
<el-input v-model="ruleForm.dwdz"></el-input>
</el-form-item>
</el-col>
......@@ -77,6 +77,27 @@
</template>
<script>
const checkPhone = (rule, value, callback) => {
let regPone = null
let mobile = /^(1[3456789]\d{9})$/ //手机号
let tel = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/ // 座机
if (value && value[0] === '0') {// 检查 value 是否存在并且不是 null 或者 undefined
regPone = tel
} else if (value && value[0] !== '0') {
regPone = mobile
}
if (regPone === null) {
return callback(
new Error('请输入电话')
)
} else if (!regPone.test(value)) {
return callback(
new Error("请输入正确的电话格式,其中座机格式'区号-座机号码'")
)
} else {
callback()
}
};
import store from '@/store/index.js'
import { addQy, update } from "@/api/xxba.js"
import clxx from './clxx/index.vue'
......@@ -126,23 +147,29 @@
zslx: 2
}
],
//证书入库业务号参数
ywhQueryForm: {
serialtype: 'zsrkbh',
serialname: '证书入库编号',
serialcode: 'zsrk',
digit: '5'
},
rules: {
batchNo: [
{ required: true, message: '入库编号不能为空', trigger: 'blur' }
qymc: [
{ required: true, message: '企业名称不能为空', trigger: 'blur' }
],
dh: [
{ required: true, validator: checkPhone, trigger: ["blur"] },
],
zjzl: [
{ required: true, message: '请选择证件种类', trigger: 'change' }
],
zjh: [
{ required: true, message: '请输入证件号', trigger: 'blur' }
],
frmc: [
{ required: true, message: '请输入法人名称', trigger: 'blur' }
],
frdh: [
{ required: true, validator: checkPhone, trigger: ["blur"] },
],
djjg: [
{ required: true, message: '请选择登记机构', trigger: 'change' }
dwdz: [
{ required: true, message: '请输入单位地址', trigger: 'blur' }
],
rksj: [
{ required: true, message: '请选择入库时间', trigger: 'change' }
]
}
}
},
......@@ -164,13 +191,14 @@
* @author: renchao
*/
submitForm () {
let list = Object.keys(this.formData).length
let that = this
this.tableForm.forEach((item, index) => {
if (item.bs < 0) {
return;
}
})
if (list > 0) {
if (this.formData.isAdd != 1) {
store.dispatch('user/reWorkFresh', false)
update(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message.success('保存成功')
......@@ -185,17 +213,25 @@
}
})
} else {
addQy(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message.success('保存成功')
this.$emit("input", false);
this.$refs['ruleForm'].resetFields();
this.resetTableFields();
this.closeDialog();
//刷新列表
store.dispatch('user/reWorkFresh', true)
that.$refs['ruleForm'].validate((valid) => {
if (valid) {
store.dispatch('user/reWorkFresh', false)
addQy(this.ruleForm).then(res => {
if (res.code == 200) {
that.$message.success('保存成功')
that.$emit("input", false);
that.$refs['ruleForm'].resetFields();
that.resetTableFields();
that.closeDialog();
//刷新列表
store.dispatch('user/reWorkFresh', true)
} else {
that.$message.error(res.message);
}
})
} else {
this.$message.error(res.message);
this.$message.error('请完善表单');
return false;
}
})
}
......