企业名单必填

pull/48/head
lukeyan 1 year ago
parent 6447486918
commit e4099fd591

@ -4,7 +4,8 @@ import vm from "../main";
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const request = axios.create({ const request = axios.create({
baseURL: 'http://172.18.113.50:8080/zhapi', //baseURL: 'http://172.18.113.50:8080/zhapi',
baseURL: 'http://192.168.0.188:8888/zhapi',
//baseURL: `http://${window.location.host}/zhapi`, //baseURL: `http://${window.location.host}/zhapi`,
timeout: 50000, timeout: 50000,
headers: { 'content-type': 'application/json' }, headers: { 'content-type': 'application/json' },

@ -15,6 +15,7 @@
<el-form <el-form
ref="commerceMessage_form" ref="commerceMessage_form"
:model="form" :model="form"
:rules="rules"
class="commerceMessage_form" class="commerceMessage_form"
> >
<el-form-item label="企业名称" prop="companyName"> <el-form-item label="企业名称" prop="companyName">
@ -69,6 +70,7 @@
<el-form <el-form
ref="commerceMessage_form_two" ref="commerceMessage_form_two"
:model="form" :model="form"
:rules="rules"
class="commerceMessage_form_two" class="commerceMessage_form_two"
> >
<el-form-item label="企业登记注册地" prop="registerAddress"> <el-form-item label="企业登记注册地" prop="registerAddress">
@ -112,6 +114,7 @@
<el-form <el-form
ref="company_position_form" ref="company_position_form"
:model="form" :model="form"
:rules="rules"
class="company_position_form" class="company_position_form"
> >
<el-form-item label="省份名称" prop="provinceName"> <el-form-item label="省份名称" prop="provinceName">
@ -312,6 +315,29 @@ export default {
upheaders: { upheaders: {
Authorization: localStorage.getItem("AuthorizationToken"), Authorization: localStorage.getItem("AuthorizationToken"),
}, },
rules:{
companyName: [
{ required: true, message: "请选择企业", trigger: "change" },
],
companyTypes:[
{ type: 'array', required: true, message: '请至少选择一个企业类型', trigger: 'change' }
],
provinceName:[
{ required: true, message: "请选择省份名称", trigger: "change" },
],
cityName:[
{ required: true, message: "请选择城市名称", trigger: "change" },
],
areaName:[
{ required: true, message: "请选择区县名称", trigger: "change" },
],
blockName:[
{ required: true, message: "请选择街道/乡镇名称", trigger: "change" },
],
streetName:[
{ required: true, message: "请选择社区/村名称", trigger: "change" },
],
}
}; };
}, },
created() { created() {
@ -361,7 +387,7 @@ export default {
Object.assign(this.form, newForm); Object.assign(this.form, newForm);
} else if (num === 3) { } else if (num === 3) {
this.dialogTitle = "编辑"; this.dialogTitle = "编辑";
console.log("item", item); console.log("item123", item);
this.imageUrl = item.picUrl; this.imageUrl = item.picUrl;
this.form = Object.assign(this.form, item); this.form = Object.assign(this.form, item);
} }

@ -21,7 +21,7 @@
<label slot="label" <label slot="label"
>+&nbsp;&nbsp;&nbsp;{{ item.indexName }}&nbsp;&nbsp;&nbsp;×</label >+&nbsp;&nbsp;&nbsp;{{ item.indexName }}&nbsp;&nbsp;&nbsp;×</label
> >
<el-input v-model="item.rate"></el-input> <el-input v-model="item.rate" oninput="value=value.replace(/^0+/,0)"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 编辑表单 --> <!-- 编辑表单 -->
@ -34,7 +34,7 @@
<label slot="label" <label slot="label"
>+&nbsp;&nbsp;&nbsp;{{ item.indexName }}&nbsp;&nbsp;&nbsp;×</label >+&nbsp;&nbsp;&nbsp;{{ item.indexName }}&nbsp;&nbsp;&nbsp;×</label
> >
<el-input v-model="item.rate"></el-input> <el-input v-model="item.rate" oninput="value=value.replace(/^0+/,0)"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div v-if="btn_flag" class="massage_btn"> <div v-if="btn_flag" class="massage_btn">
@ -148,6 +148,7 @@ export default {
// console.log('this.all_data.toFixed(2)',this.all_data.toFixed(2)); // console.log('this.all_data.toFixed(2)',this.all_data.toFixed(2));
} }
} }
if (isNaN(this.all_data) || this.all_data.toFixed(2) != 1) { if (isNaN(this.all_data) || this.all_data.toFixed(2) != 1) {
this.$message.warning("保存失败,各指标占比应大于等于0且总和应等于1"); this.$message.warning("保存失败,各指标占比应大于等于0且总和应等于1");
} else { } else {

Loading…
Cancel
Save