|
@@ -97,10 +97,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8" v-show="ruleForm.is_project === '1'">
|
|
|
- <el-form-item
|
|
|
- label="项目名称"
|
|
|
- :prop="ruleForm.is_project === '1' ? 'projectNo' : ''"
|
|
|
- >
|
|
|
+ <el-form-item label="项目名称" prop="projectNo">
|
|
|
<el-select
|
|
|
v-model="ruleForm.projectNo"
|
|
|
multiple
|
|
@@ -473,7 +470,7 @@
|
|
|
<el-col :span="24">
|
|
|
<el-row>
|
|
|
<el-col :span="12" v-show="is_noble">
|
|
|
- <el-form-item label="配置要求" :prop="is_noble ? 'config' : ''">
|
|
|
+ <el-form-item label="配置要求" prop="config">
|
|
|
<el-select
|
|
|
v-model="ruleForm.config"
|
|
|
multiple
|
|
@@ -492,10 +489,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6" v-show="is_noble">
|
|
|
- <el-form-item
|
|
|
- label="金属克重"
|
|
|
- :prop="is_noble ? 'specs_weight' : ''"
|
|
|
- >
|
|
|
+ <el-form-item label="金属克重" prop="specs_weight">
|
|
|
<digital-input
|
|
|
:values="ruleForm.specs_weight"
|
|
|
:placeholder="'金属克重'"
|
|
@@ -512,10 +506,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6" v-show="is_noble">
|
|
|
- <el-form-item
|
|
|
- label="启用金价"
|
|
|
- :prop="is_noble ? 'is_gold_price' : ''"
|
|
|
- >
|
|
|
+ <el-form-item label="启用金价" prop="is_gold_price">
|
|
|
<el-select
|
|
|
v-model="ruleForm.is_gold_price"
|
|
|
placeholder="启用金价"
|
|
@@ -572,10 +563,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8" v-show="is_noble">
|
|
|
- <el-form-item
|
|
|
- label="金属种类"
|
|
|
- :prop="is_noble ? 'metal_id' : ''"
|
|
|
- >
|
|
|
+ <el-form-item label="金属种类" prop="metal_id">
|
|
|
<search-metal-kind
|
|
|
:value="ruleForm.metal_id"
|
|
|
:size="'mini'"
|
|
@@ -586,9 +574,8 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- v-show="ruleForm.is_gold_price === '1'"
|
|
|
+ v-if="ruleForm.is_gold_price === '1'"
|
|
|
label="当前金价"
|
|
|
- :prop="ruleForm.is_gold_price === '1' ? 'gold_price' : ''"
|
|
|
style="margin: 0 0 0 0"
|
|
|
>
|
|
|
<el-input
|
|
@@ -601,9 +588,8 @@
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" class="fr tr">
|
|
|
+ <el-col :span="8" class="fr tr" v-show="is_noble">
|
|
|
<el-form-item
|
|
|
- v-show="is_noble"
|
|
|
label="其他配置要求"
|
|
|
prop="other_config"
|
|
|
label-width="120px"
|
|
@@ -617,6 +603,8 @@
|
|
|
maxlength="200"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="fr tr">
|
|
|
<el-button
|
|
|
v-if="type !== 'view'"
|
|
|
type="primary"
|
|
@@ -634,7 +622,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
-
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</template>
|
|
@@ -785,6 +772,7 @@ export default {
|
|
|
this.rulesThis = this.rules;
|
|
|
this.disabled = false;
|
|
|
await this.resetForm();
|
|
|
+ this.sch_is_noble();
|
|
|
this.loading = false;
|
|
|
},
|
|
|
|
|
@@ -792,6 +780,28 @@ export default {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
|
|
|
+ sch_is_noble() {
|
|
|
+ this.rulesThis["projectNo"][0].required =
|
|
|
+ this.ruleForm.is_project === "1";
|
|
|
+ this.$refs.ruleForm.validateField("projectNo");
|
|
|
+ let list = [
|
|
|
+ "config",
|
|
|
+ "specs_weight",
|
|
|
+ "is_gold_price",
|
|
|
+ "metal_id",
|
|
|
+ "other_config",
|
|
|
+ "gold_price"
|
|
|
+ ];
|
|
|
+
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (this.rulesThis[list[i]]) {
|
|
|
+ this.rulesThis[list[i]][0].required = this.is_noble;
|
|
|
+ console.log(list[i] + "===" + this.rulesThis[list[i]][0].required);
|
|
|
+ this.$refs.ruleForm.validateField(list[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
//咨询类型选择
|
|
|
is_project_change() {
|
|
|
const { is_project } = this.ruleForm;
|
|
@@ -946,7 +956,7 @@ export default {
|
|
|
this.showOtherModel = false;
|
|
|
},
|
|
|
async submitForm() {
|
|
|
- console.log(this.ruleForm);
|
|
|
+ this.sch_is_noble();
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|