|
@@ -25,8 +25,8 @@
|
|
|
label-width="90px"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
- <el-row style="">
|
|
|
- <el-col :span="1" style="height: 336px; border-right: 1px solid #dcdfe6">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="1" style="padding: 20px 0 0 0">
|
|
|
<ul class="tc fff">
|
|
|
<li>企</li>
|
|
|
<li>业</li>
|
|
@@ -34,142 +34,80 @@
|
|
|
<li>息</li>
|
|
|
</ul>
|
|
|
</el-col>
|
|
|
- <el-col :span="23">
|
|
|
+ <el-col :span="23" style="border-left: 1px solid #dcdfe6">
|
|
|
<el-row>
|
|
|
- <el-col :span="13">
|
|
|
- <el-form-item label="企业名称" prop="company">
|
|
|
- <el-input
|
|
|
- placeholder="企业名称"
|
|
|
- filterable
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- maxlength="100"
|
|
|
- clearable
|
|
|
- v-model="ruleForm.company"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="11"
|
|
|
- ><el-form-item
|
|
|
- label="统一社会信用代码"
|
|
|
- prop="inv_code"
|
|
|
- label-width="150px"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- placeholder="统一社会信用代码"
|
|
|
- filterable
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- maxlength="40"
|
|
|
- clearable
|
|
|
- v-model="ruleForm.inv_code"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="13">
|
|
|
- <el-form-item label="详细地址" prop="inv_addr">
|
|
|
- <el-input
|
|
|
- placeholder="详细地址"
|
|
|
- v-model="ruleForm.inv_addr"
|
|
|
- maxlength="100"
|
|
|
- clearable
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="11">
|
|
|
- <el-form-item label="法人" prop="inv_legaler">
|
|
|
- <el-input
|
|
|
- placeholder="法人"
|
|
|
- v-model="ruleForm.inv_legaler"
|
|
|
- maxlength="12"
|
|
|
- minlength="2"
|
|
|
- clearable
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- /> </el-form-item
|
|
|
- ></el-col>
|
|
|
- <el-col :span="13">
|
|
|
- <el-form-item label="成立日期" prop="inv_time">
|
|
|
- <el-date-picker
|
|
|
- style="width: 100%"
|
|
|
- v-model="ruleForm.inv_time"
|
|
|
- align="right"
|
|
|
- type="date"
|
|
|
- placeholder="成立日期"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="11">
|
|
|
- <el-form-item label="联系人" prop="contactor">
|
|
|
- <el-input
|
|
|
- placeholder="联系人"
|
|
|
- v-model="ruleForm.contactor"
|
|
|
- maxlength="12"
|
|
|
- minlength="2"
|
|
|
- clearable
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- /> </el-form-item
|
|
|
- ></el-col>
|
|
|
- <el-col :span="13">
|
|
|
- <el-form-item label="营业范围" prop="inv_scope">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.inv_scope"
|
|
|
- type="textarea"
|
|
|
- placeholder="营业范围"
|
|
|
- maxlength="2000"
|
|
|
- :rows="8"
|
|
|
- show-word-limit
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="11">
|
|
|
- <el-form-item label="公司类型" prop="type">
|
|
|
- <search-company-type
|
|
|
- :value="ruleForm.type"
|
|
|
- :disabled="false"
|
|
|
- :size="'mini'"
|
|
|
- :isDetail="false"
|
|
|
- :placeholder="'公司类型'"
|
|
|
- @searchChange="type_search_change"
|
|
|
- /> </el-form-item
|
|
|
- ></el-col>
|
|
|
-
|
|
|
- <el-col :span="11" style="height: 124px">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="法人" required>
|
|
|
+ {{ ruleForm.inv_legaler }}</el-form-item
|
|
|
+ ></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="4">
|
|
|
<el-form-item
|
|
|
label="营业执照"
|
|
|
prop="license_img"
|
|
|
class="activity-upload"
|
|
|
>
|
|
|
- <div class="btnupload" style="position: relative">
|
|
|
+ <div
|
|
|
+ class="btnupload"
|
|
|
+ style="position: relative; width: 28px; height: 28px"
|
|
|
+ >
|
|
|
<img
|
|
|
v-if="ruleForm.license_img"
|
|
|
:src="ruleForm.license_img"
|
|
|
+ v-viewer
|
|
|
class="avatar"
|
|
|
/>
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- <file-upload
|
|
|
- class="Upload"
|
|
|
- :disabled="isDetail == '007'"
|
|
|
- :accept="'.jpg,.png,.jpeg'"
|
|
|
- :multiple="true"
|
|
|
- :uploadcondition="beforeAvatarUpload"
|
|
|
- @UploadErrorEvent="UploadErrorEvent"
|
|
|
- @UploadSuccessEvent="UploadSuccessEvent"
|
|
|
- ></file-upload>
|
|
|
- </div>
|
|
|
- <div class="txt-tips fl">
|
|
|
- <p>大小:小于1M</p>
|
|
|
- <p>尺寸:100*100</p>
|
|
|
- <p>类型:jpg.png.jpeg</p>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="企业名称" required>
|
|
|
+ {{ ruleForm.company }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-form-item
|
|
|
+ label="纳税识别号"
|
|
|
+ required
|
|
|
+ label-width="100px"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ {{ ruleForm.inv_code }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="成立日期" required>
|
|
|
+ {{ ruleForm.inv_time }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-form-item label="公司类型" required>
|
|
|
+ {{ ruleForm.type }}</el-form-item
|
|
|
+ ></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="详细地址" required>
|
|
|
+ {{ ruleForm.addr }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="联系人" required>
|
|
|
+ {{ ruleForm.contactor }}
|
|
|
+ </el-form-item></el-col
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="营业范围" required>
|
|
|
+ {{ ruleForm.inv_scope }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -216,7 +154,7 @@
|
|
|
<el-col :span="13">
|
|
|
<el-form-item label="联系地址" prop="addr">
|
|
|
<el-input
|
|
|
- v-model="ruleForm.addr"
|
|
|
+ v-model="ruleForm.inv_addr"
|
|
|
placeholder="联系地址"
|
|
|
maxlength="100"
|
|
|
:disabled="isDetail == '007'"
|
|
@@ -257,32 +195,12 @@
|
|
|
<script>
|
|
|
import asyncRequest from "@/apis/service/serviceParam/workCompany";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import {
|
|
|
- isMobile,
|
|
|
- isLicense,
|
|
|
- isPhone,
|
|
|
- isChinese,
|
|
|
- isEmoticon,
|
|
|
- isSpecialSymbol,
|
|
|
- hasSpace,
|
|
|
- isAddr,
|
|
|
-} from "@/utils/validate";
|
|
|
+import { isMobile, isPhone, invTime } from "@/utils/validate";
|
|
|
export default {
|
|
|
name: "workCompany",
|
|
|
props: ["showModel", "id", "isDetail"],
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
- const validateLicense = (rule, value, callback) => {
|
|
|
- if (value !== "") {
|
|
|
- if (!isLicense(value)) {
|
|
|
- callback(new Error("统一社会信用代码不正确!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- } else {
|
|
|
- callback(new Error("统一社会信用代码不能为空!"));
|
|
|
- }
|
|
|
- };
|
|
|
const validatemobile = (rule, value, callback) => {
|
|
|
if (value !== "") {
|
|
|
if (isPhone(value) || isMobile(value)) {
|
|
@@ -294,47 +212,7 @@ export default {
|
|
|
callback(new Error("联系电话不能为空!"));
|
|
|
}
|
|
|
};
|
|
|
- const validatename = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("法人不能为空!"));
|
|
|
- } else {
|
|
|
- if (!isChinese(value)) {
|
|
|
- callback(new Error("法人只能为汉字!"));
|
|
|
- } else if (isEmoticon(value)) {
|
|
|
- callback(new Error("法人只能为汉字!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validatecontactor = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("联系人不能为空!"));
|
|
|
- } else {
|
|
|
- if (!isChinese(value)) {
|
|
|
- callback(new Error("联系人只能为汉字!"));
|
|
|
- } else if (isEmoticon(value)) {
|
|
|
- callback(new Error("联系人只能为汉字!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validateAddr = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("详细地址不能为空!"));
|
|
|
- } else {
|
|
|
- if (hasSpace(value)) {
|
|
|
- callback(new Error("不能出现/回车/换行符!"));
|
|
|
- } else if (isSpecialSymbol(value)) {
|
|
|
- callback(new Error("不能使用英文特殊字符!"));
|
|
|
- } else if (isAddr(value)) {
|
|
|
- callback();
|
|
|
- } else {
|
|
|
- callback(new Error("详细地址填写不规范!"));
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
+
|
|
|
return {
|
|
|
pickerOptions: {
|
|
|
disabledDate(time) {
|
|
@@ -364,43 +242,6 @@ export default {
|
|
|
},
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
- company: [{ required: true, message: "企业名称不能为空!", trigger: "blur" }],
|
|
|
- type: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "公司类型不能为空!",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- inv_code: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: validateLicense,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- inv_legaler: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: validatename,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
-
|
|
|
- inv_time: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "成立日期不能为空!",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- inv_addr: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: validateAddr,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
inv_bank: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -415,13 +256,7 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- contactor: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: validatecontactor,
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
+
|
|
|
mobile: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -429,15 +264,7 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- addr: [{ required: true, message: "联系地址不能为空!", trigger: "blur" }],
|
|
|
- inv_scope: [{ required: true, message: "经营范围不能为空!", trigger: "blur" }],
|
|
|
- license_img: [
|
|
|
- {
|
|
|
- required: false,
|
|
|
- message: "",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
+ inv_addr: [{ required: true, message: "联系地址不能为空!", trigger: "blur" }],
|
|
|
},
|
|
|
};
|
|
|
},
|
|
@@ -458,11 +285,7 @@ export default {
|
|
|
async initForm() {
|
|
|
this.supplier_name = "";
|
|
|
this.loading = true;
|
|
|
- if (this.isDetail === "003") {
|
|
|
- this.title = "新建业务企业";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- } else if (this.isDetail == "007") {
|
|
|
+ if (this.isDetail == "007") {
|
|
|
this.title = "业务企业详情";
|
|
|
this.rulesThis = {};
|
|
|
await this.resetForm();
|
|
@@ -492,7 +315,7 @@ export default {
|
|
|
const {
|
|
|
id,
|
|
|
company, //公司名称
|
|
|
- type, // 公司类型
|
|
|
+ company_type, // 公司类型
|
|
|
inv_code, // 纳税识别号
|
|
|
inv_legaler, // 法人
|
|
|
inv_time, //注册日期
|
|
@@ -509,10 +332,10 @@ export default {
|
|
|
this.ruleForm = {
|
|
|
id: id || "",
|
|
|
company: company || "", //公司名称
|
|
|
- type: type || "", // 公司类型
|
|
|
+ type: company_type || "", // 公司类型
|
|
|
inv_code: inv_code || "", // 纳税识别号
|
|
|
inv_legaler: inv_legaler || "", // 法人
|
|
|
- inv_time: inv_time || "", //注册日期
|
|
|
+ inv_time: invTime(inv_time) || "", //注册日期
|
|
|
inv_addr: inv_addr || "", //注册地址
|
|
|
inv_bank: inv_bank || "", // 银行
|
|
|
inv_bankNo: inv_bankNo || "", // 银行账户
|
|
@@ -561,20 +384,22 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.loading = true;
|
|
|
- let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ const { code, inv_bank, inv_bankNo, inv_addr, mobile, id } = this.ruleForm;
|
|
|
+
|
|
|
+ const model = {
|
|
|
+ id,
|
|
|
+ code,
|
|
|
+ inv_bank,
|
|
|
+ inv_bankNo,
|
|
|
+ inv_addr,
|
|
|
+ mobile,
|
|
|
+ };
|
|
|
+ const res = await asyncRequest.update(model);
|
|
|
|
|
|
- let res = {};
|
|
|
- if (this.isDetail === "003") {
|
|
|
- delete model["id"];
|
|
|
- res = await asyncRequest.add(model);
|
|
|
- } else {
|
|
|
- res = await asyncRequest.update(model);
|
|
|
- }
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
|
- const title = this.isDetail === "003" ? "添加成功" : "修改成功";
|
|
|
this.$notify.success({
|
|
|
- title,
|
|
|
+ title: "修改成功",
|
|
|
message: "",
|
|
|
});
|
|
|
this.showModelThis = false;
|