Quellcode durchsuchen

需求发布之后信息重置

luyanan vor 6 Jahren
Ursprung
Commit
d19f051347

+ 9 - 2
src/components/form-views/DemandIssue.vue

@ -8,7 +8,7 @@
8 8
        <el-input type="textarea" :rows="4" v-model="ruleFormDem.demandDesc" placeholder="请描述您的需求背景、具体问题、对专家的要求等等"></el-input>
9 9
      </el-form-item>
10 10
      <el-col :span="12">
11
        <CityPick :widthselect="148" :prov="ruleFormDem.province" :city="ruleFormDem.city" v-on:selectProv="getSelectProv($event)" v-on:selectCity="getSelectCity($event)"></CityPick>
11
        <CityPick ref="cityPick" :widthselect="148" :prov="ruleFormDem.province" :city="ruleFormDem.city" v-on:selectProv="getSelectProv($event)" v-on:selectCity="getSelectCity($event)"></CityPick>
12 12
        <!-- <el-form-item label="所在城市" prop="citys">
13 13
          <el-cascader
14 14
            :options="optionsCity"
@ -90,7 +90,7 @@
90 90
      <el-col :span="24" >
91 91
        <el-form-item style="text-align:center">
92 92
          <el-button type="primary" @click="submitForm('ruleFormDem')" style="padding: 12px 50px">立即发布</el-button><br/>
93
          <el-checkbox checked disabled>我已阅读并同意<a :href="kexiuLink + '/privacy.html'">《科袖用户协议》</a></el-checkbox>
93
          <el-checkbox checked disabled>我已阅读并同意<a :href="kexiuLink + '/privacy.html'" target="_blank">《科袖用户协议》</a></el-checkbox>
94 94
        </el-form-item>
95 95
      </el-col>
96 96
    </el-form>
@ -239,6 +239,12 @@
239 239
      changeImgVc() {
240 240
        this.imgVcUrl = httpUrl.kxQurey.sign.imgVC + '?' + new Date().getTime();
241 241
      },
242
      resetForm(formName) {
243
        this.$refs.cityPick.resetProvCity();
244
        this.selectCostRange = '';
245
        this.selectLongTime = '';
246
        this.$refs[formName].resetFields();
247
      },
242 248
      submitForm(formName) {
243 249
        this.$refs[formName].validate((valid) => {
244 250
          if (valid) {
@ -271,6 +277,7 @@
271 277
                    };
272 278
                  }
273 279
                });
280
                this.resetForm(formName);
274 281
                this.$emit('dialogChanged', false);
275 282
              } else {
276 283
                this.$message({

+ 11 - 1
src/components/form-views/DemandIssueLogin.vue

@ -27,7 +27,7 @@
27 27
        <el-input type="textarea" :rows="4" v-model="ruleFormDem.demandDesc" placeholder="请描述您的需求背景、具体问题、对专家的要求等等"></el-input>
28 28
      </el-form-item>
29 29
      <el-col :span="12">
30
        <CityPick :widthselect="148" :prov="ruleFormDem.province" :city="ruleFormDem.city" v-on:selectProv="getSelectProv($event)" v-on:selectCity="getSelectCity($event)"></CityPick>
30
        <CityPick ref="cityPick" :widthselect="148" :prov="ruleFormDem.province" :city="ruleFormDem.city" v-on:selectProv="getSelectProv($event)" v-on:selectCity="getSelectCity($event)"></CityPick>
31 31
      </el-col>
32 32
      <el-col :span="12">
33 33
        <el-form-item label="需求有效期" prop="lastDate">
@ -211,6 +211,7 @@
211 211
                  center: true,
212 212
                  callback: action => {
213 213
                    this.ifLogin = false;
214
                    this.$refs[formName].resetFields();
214 215
                  }
215 216
                });
216 217
              };
@ -286,7 +287,15 @@
286 287
        });
287 288
      },
288 289
      // 获取科袖账户信息
290

289 291
      // 发布需求
292
      resetForm(formName) {
293
        this.$refs.cityPick.resetProvCity();
294
        this.selectCostRange = '';
295
        this.selectLongTime = '';
296
        this.ifLogin = true;
297
        this.$refs[formName].resetFields();
298
      },
290 299
      submitForm(formName) {
291 300
        this.$refs[formName].validate((valid) => {
292 301
          if (valid) {
@ -316,6 +325,7 @@
316 325
                    };
317 326
                  }
318 327
                });
328
                this.resetForm(formName);
319 329
                this.$emit('dialogChangedLogin', false);
320 330
              } else {
321 331
                this.$message({

+ 8 - 2
src/components/global-component/citypick/CityPick.vue

@ -71,7 +71,7 @@
71 71
      }
72 72
    },
73 73
    methods: { // 二级联动选择地区
74
      getProv: function (prov) {
74
      getProv(prov) {
75 75
        let tempCity = [];
76 76
        this.citys = [];
77 77
        this.selectCity = '';
@ -84,11 +84,17 @@
84 84
        this.$emit('selectProv', this.selectProv);
85 85
        this.$emit('selectCity', this.selectCity);
86 86
      },
87
      getCity: function (city) {
87
      getCity(city) {
88 88
        console.log(city);
89 89
        console.log(this.selectCity);
90 90
        this.$emit('selectProv', this.selectProv);
91 91
        this.$emit('selectCity', this.selectCity);
92
      },
93
      resetProvCity() {
94
        this.selectProv = '';
95
        this.selectCity = '';
96
        this.$emit('selectProv', this.selectProv);
97
        this.$emit('selectCity', this.selectCity);
92 98
      }
93 99
    }
94 100
  };

+ 5 - 1
src/components/main-views/ViewHome.vue

@ -33,7 +33,7 @@
33 33
          将您的需求发布到科袖网,<br>
34 34
          我们为您对接专家和各类专业机构。
35 35
        </p>
36
        <el-button type="primary" @click="dialogFormVisible = true" style="margin-top:30px">免费发布需求</el-button>
36
        <el-button type="primary" @click="clickAlertDemand" style="margin-top:30px">免费发布需求</el-button>
37 37
      </div>
38 38
    </div>
39 39
@ -280,6 +280,10 @@
280 280
      getChildrenChangeLogin(msg) {
281 281
        this.dialogFormVisible = msg;
282 282
      },
283
      clickAlertDemand() {
284
        this.dialogFormVisible = true;
285
        this.activeName = 'first';
286
      },
283 287
      // pubDemand() {
284 288
      //   this.$refs.issueDemand.submitForm('ruleForm');
285 289
      // },