Files
PropertyDeployment/resources/Web/MicroCommunityWeb/html/components/common/company-extend/company-extend.js
2025-12-09 20:22:03 +08:00

130 lines
4.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
初始化 公司信息
**/
(function (vc) {
vc.extends({
data: {
storeTypes: [],
companyExtendInfo: {
corporation: "",
registeredCapital: "",
foundingTime: "",
registrationAuthority: "",
scope: ""
}
},
_initMethod: function () {
vc.component._extendInitDate();
},
_initEvent: function () {
// vc.component.$on('errorInfoEvent',function(_errorInfo){
// vc.component.registerInfo.errorInfo = _errorInfo;
// console.log('errorInfoEvent 事件被监听',_errorInfo)
// });
},
watch: {
companyExtendInfo: {
deep: true,
handler: function () {
vc.component.$emit('companyExtendEvent', vc.component.companyExtendInfo);
}
}
},
methods: {
validateExtend: function () {
return vc.validate.validate({
companyExtendInfo: vc.component.companyExtendInfo
}, {
'companyExtendInfo.corporation': [
{
limit: "required",
param: "",
errInfo: "法人不能为空"
},
{
limit: "maxLength",
param: "50",
errInfo: "法人长度必须在50位之内"
},
],
'companyExtendInfo.registeredCapital': [
{
limit: "required",
param: "",
errInfo: "注册资本不能为空"
},
{
limit: "num",
param: "50",
errInfo: "注册资本必须是数字"
},
],
'companyExtendInfo.foundingTime': [
{
limit: "required",
param: "",
errInfo: "成立时间不能为空"
},
{
limit: "date",
param: "",
errInfo: "不是有效的日期例如2019-03-29"
}
],
'companyExtendInfo.registrationAuthority': [
{
limit: "required",
param: "",
errInfo: "登记机关不能为空"
},
{
limit: "maxLength",
param: "50",
errInfo: "登记机关长度必须在50位之内"
}
],
'companyExtendInfo.scope': [
{
limit: "required",
param: "",
errInfo: "经营范围不能为空"
},
{
limit: "maxLength",
param: "50",
errInfo: "经营范围长度必须在50位之内"
}
],
});
},
_extendInitDate: function () {
$('.extend_time').datetimepicker({
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd',
minView: "month",
initialDate: new Date(),
autoClose: 1,
todayBtn: true
});
$('.extend_time').datetimepicker()
.on('changeDate', function (ev) {
var value = $(".extend_time").val();
vc.component.companyExtendInfo.foundingTime = value;
});
}
}
});
})(window.vc);