|
@@ -12,6 +12,7 @@
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
@close="showModelThis = false"
|
|
|
+ append-to-body
|
|
|
>
|
|
|
<el-card style="margin: -20px 0 0 0">
|
|
|
<el-row :gutter="10">
|
|
@@ -70,7 +71,7 @@
|
|
|
:disabled="ruleForm.p_budget_price"
|
|
|
:controls="false"
|
|
|
:append="'元'"
|
|
|
- @reschange="budget_price_change"
|
|
|
+ @reschange="num_change($event, 'budget_price')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -87,7 +88,7 @@
|
|
|
:disabled="ruleForm.p_num"
|
|
|
:controls="false"
|
|
|
:append="''"
|
|
|
- @reschange="num_change"
|
|
|
+ @reschange="num_change($event, 'num')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -134,7 +135,7 @@
|
|
|
:controls="false"
|
|
|
:size="'mini'"
|
|
|
:append="'g'"
|
|
|
- @reschange="total_weight_change"
|
|
|
+ @reschange="num_change($event, 'total_weight')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -142,7 +143,6 @@
|
|
|
<el-form-item label="单位" prop="unit" label-width="60px">
|
|
|
<search-unit
|
|
|
:value="ruleForm.unit"
|
|
|
- :disabled="id == '007'"
|
|
|
:size="'mini'"
|
|
|
:isDetail="unit_name !== ''"
|
|
|
:names="unit_name"
|
|
@@ -168,7 +168,7 @@
|
|
|
<el-form-item label="商品名称" prop="good_name">
|
|
|
<el-input
|
|
|
v-model="ruleForm.good_name"
|
|
|
- :disabled="ruleForm.p_good_name"
|
|
|
+ :disabled="false"
|
|
|
placeholder="商品名称"
|
|
|
maxlength="100"
|
|
|
/>
|
|
@@ -178,7 +178,6 @@
|
|
|
<el-form-item label="工艺说明" prop="cost_desc">
|
|
|
<el-input
|
|
|
v-model="ruleForm.cost_desc"
|
|
|
- :disabled="id == '007'"
|
|
|
placeholder="工艺说明"
|
|
|
maxlength="500"
|
|
|
/>
|
|
@@ -186,7 +185,6 @@
|
|
|
<el-form-item label="产品用途" prop="use_desc">
|
|
|
<el-input
|
|
|
v-model="ruleForm.use_desc"
|
|
|
- :disabled="id == '007'"
|
|
|
placeholder="产品用途"
|
|
|
maxlength="500"
|
|
|
/>
|
|
@@ -194,25 +192,22 @@
|
|
|
<el-form-item label="商品备注" prop="remark">
|
|
|
<el-input
|
|
|
v-model="ruleForm.remark"
|
|
|
- :disabled="id == '007'"
|
|
|
placeholder="商品备注"
|
|
|
maxlength="500"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" style="padding 0 0 0 12px">
|
|
|
+ <el-col :span="12" style="padding: 0 0 0 15px">
|
|
|
<el-table
|
|
|
:data="spec_tableData"
|
|
|
:size="'mini'"
|
|
|
border
|
|
|
style="width: 100%"
|
|
|
+ height="120px"
|
|
|
>
|
|
|
<el-table-column prop="spec_value" label="规格类型" />
|
|
|
<el-table-column prop="spec_value_value" label="规格值" />
|
|
|
- <el-table-column
|
|
|
- fixed="right"
|
|
|
- v-if="type === 'add' || type === 'editBase'"
|
|
|
- >
|
|
|
+ <el-table-column fixed="right" width="88px">
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
<span>操作</span>
|
|
|
<el-tooltip
|
|
@@ -229,159 +224,168 @@
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- @click="openEdit(scope.$index, scope.row)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click="openDelete(scope.$index)"
|
|
|
- >移除</el-button
|
|
|
- >
|
|
|
+ <el-tooltip effect="dark" content="修改" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-edit tb-icon"
|
|
|
+ @click="openEdit(scope.$index, scope.row)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="dark" content="删除" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-delete tb-icon"
|
|
|
+ @click="openDelete(scope.$index)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<!-- 弹窗 新增/修改 -->
|
|
|
<base-form-add-edit
|
|
|
:index="modelIndex"
|
|
|
- :show-model="showModel"
|
|
|
- :sitem="sitem"
|
|
|
+ :show-model="showOtherModel"
|
|
|
+ :sitem="modelSitem"
|
|
|
@refresh="refreshEdit"
|
|
|
- @cancel="showModel = false"
|
|
|
+ @cancel="showOtherModel = false"
|
|
|
/>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" v-if="is_noble">
|
|
|
- <el-form-item label="启用金价" prop="is_gold_price">
|
|
|
- <el-select
|
|
|
- v-model="ruleForm.is_gold_price"
|
|
|
- placeholder="启用金价"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in is_gold_price_options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="16" v-if="is_noble">
|
|
|
- <el-form-item label="配置要求" prop="config">
|
|
|
- <el-select
|
|
|
- v-model="ruleForm.config"
|
|
|
- multiple
|
|
|
- style="width: 100%"
|
|
|
- placeholder="配置要求"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in config_options"
|
|
|
- :key="item + index"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="8" v-if="is_noble">
|
|
|
- <el-form-item label="金属克重" prop="specs_weight">
|
|
|
- <digital-input
|
|
|
- :values="ruleForm.specs_weight"
|
|
|
- :placeholder="'金属克重'"
|
|
|
- :min="0"
|
|
|
- :max="100000000000"
|
|
|
- :position="'right'"
|
|
|
- :precision="3"
|
|
|
- :controls="false"
|
|
|
- :size="'mini'"
|
|
|
- :append="'g'"
|
|
|
- @reschange="specs_weight_change"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="16" v-if="is_noble">
|
|
|
- <el-form-item label="其他要求" prop="other_config">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.other_config"
|
|
|
- :disabled="id == '007'"
|
|
|
- placeholder="其他要求"
|
|
|
- maxlength="20"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
+ <el-col :span="24" v-if="is_noble">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12" v-if="is_noble">
|
|
|
+ <el-form-item label="配置要求" prop="config">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.config"
|
|
|
+ multiple
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="配置要求"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in config_options"
|
|
|
+ :key="item + index"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="is_noble">
|
|
|
+ <el-form-item label="金属克重" prop="specs_weight">
|
|
|
+ <digital-input
|
|
|
+ :values="ruleForm.specs_weight"
|
|
|
+ :placeholder="'金属克重'"
|
|
|
+ :min="0"
|
|
|
+ :max="100000000000"
|
|
|
+ :position="'right'"
|
|
|
+ :precision="3"
|
|
|
+ :controls="false"
|
|
|
+ :size="'mini'"
|
|
|
+ :append="'g'"
|
|
|
+ @reschange="num_change($event, 'specs_weight')"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="启用金价" prop="is_gold_price">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.is_gold_price"
|
|
|
+ placeholder="启用金价"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in is_gold_price_options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="商品图片"
|
|
|
- prop="good_img"
|
|
|
- :disabled="id == '007'"
|
|
|
- class="activity-upload"
|
|
|
- >
|
|
|
- <div class="btnupload" style="position: relative">
|
|
|
- <img
|
|
|
- v-if="ruleForm.good_img"
|
|
|
- :src="ruleForm.good_img"
|
|
|
- class="avatar"
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8" class="clear">
|
|
|
+ <el-form-item
|
|
|
+ label="商品图片"
|
|
|
+ prop="good_img"
|
|
|
+ class="activity-upload"
|
|
|
+ >
|
|
|
+ <div class="btnupload" style="position: relative">
|
|
|
+ <img
|
|
|
+ v-if="ruleForm.good_img"
|
|
|
+ :src="ruleForm.good_img"
|
|
|
+ class="avatar"
|
|
|
+ />
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ <file-upload
|
|
|
+ class="Upload"
|
|
|
+ :disabled="false"
|
|
|
+ :accept="'.jpg,.png,.jpeg'"
|
|
|
+ :multiple="true"
|
|
|
+ :uploadcondition="beforeAvatarUpload"
|
|
|
+ @UploadErrorEvent="UploadErrorEvent"
|
|
|
+ @UploadSuccessEvent="UploadSuccessEvent"
|
|
|
+ ></file-upload>
|
|
|
+ </div>
|
|
|
+ <div class="txt-tips fl">
|
|
|
+ <p>小于1Mb</p>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" v-if="is_noble">
|
|
|
+ <el-form-item label="金属种类" prop="metal_id">
|
|
|
+ <search-metal-kind
|
|
|
+ :value="ruleForm.metal_id"
|
|
|
+ :size="'mini'"
|
|
|
+ :isDetail="type !== 'add'"
|
|
|
+ :placeholder="'贵金属种类'"
|
|
|
+ @searchChange="noble_metalsearchChange"
|
|
|
/>
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- <file-upload
|
|
|
- class="Upload"
|
|
|
- :disabled="ruleForm.p_good_img"
|
|
|
- :accept="'.jpg,.png,.jpeg'"
|
|
|
- :multiple="true"
|
|
|
- :uploadcondition="beforeAvatarUpload"
|
|
|
- @UploadErrorEvent="UploadErrorEvent"
|
|
|
- @UploadSuccessEvent="UploadSuccessEvent"
|
|
|
- ></file-upload>
|
|
|
- </div>
|
|
|
- <div class="txt-tips fl">
|
|
|
- <p>小于1Mb</p>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" v-if="is_noble">
|
|
|
- <el-form-item label="金属种类" prop="metal_id">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.metal_id"
|
|
|
- :disabled="id == '007'"
|
|
|
- placeholder="金属种类"
|
|
|
- maxlength="20"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="当前金价"
|
|
|
- prop="gold_price"
|
|
|
- style="margin: 0 0 0 0"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.gold_price"
|
|
|
- disabled
|
|
|
- placeholder="当前金价"
|
|
|
- maxlength="500"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col>
|
|
|
- <el-button
|
|
|
- v-if="id !== '007'"
|
|
|
- type="primary"
|
|
|
- :size="'mini'"
|
|
|
- @click="submitForm"
|
|
|
- >保 存
|
|
|
- </el-button>
|
|
|
- <el-button :size="'mini'" @click="showModelThis = false">{{
|
|
|
- id == "007" ? "关 闭" : "取 消"
|
|
|
- }}</el-button>
|
|
|
- </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ v-if="ruleForm.is_gold_price === '1'"
|
|
|
+ label="当前金价"
|
|
|
+ prop="gold_price"
|
|
|
+ style="margin: 0 0 0 0"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.gold_price"
|
|
|
+ disabled
|
|
|
+ placeholder="当前金价"
|
|
|
+ maxlength="500"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="fr tr">
|
|
|
+ <el-form-item
|
|
|
+ label="其他配置要求"
|
|
|
+ prop="other_config"
|
|
|
+ label-width="120px"
|
|
|
+ v-if="is_noble"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.other_config"
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ placeholder="其他要求"
|
|
|
+ maxlength="200"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ v-if="id !== '007'"
|
|
|
+ type="primary"
|
|
|
+ :size="'mini'"
|
|
|
+ @click="submitForm"
|
|
|
+ >保 存
|
|
|
+ </el-button>
|
|
|
+ <el-button :size="'mini'" @click="showModelThis = false">{{
|
|
|
+ id == "007" ? "关 闭" : "取 消"
|
|
|
+ }}</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -393,12 +397,19 @@
|
|
|
<script>
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import { rules } from "../columns";
|
|
|
+import baseFormAddEdit from "./baseFormAddEdit";
|
|
|
export default {
|
|
|
name: "brand",
|
|
|
props: ["showModel", "id", "sitem"],
|
|
|
mixins: [resToken],
|
|
|
+ components: {
|
|
|
+ baseFormAddEdit,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ modelIndex: "",
|
|
|
+ modelSitem: {},
|
|
|
+ showOtherModel: false,
|
|
|
spec_tableData: [],
|
|
|
old_spec_tableData: [],
|
|
|
loading: false,
|
|
@@ -445,7 +456,7 @@ export default {
|
|
|
unit: [],
|
|
|
good_img: "",
|
|
|
good_name: "",
|
|
|
- total_weight: "0",
|
|
|
+ total_weight: "0.000",
|
|
|
is_addrs: "",
|
|
|
is_custom: "",
|
|
|
is_gold_price: "",
|
|
@@ -456,7 +467,7 @@ export default {
|
|
|
use_desc: "",
|
|
|
remark: "",
|
|
|
metal_id: "",
|
|
|
- gold_price: "",
|
|
|
+ gold_price: "0",
|
|
|
},
|
|
|
unit_name: "",
|
|
|
rulesThis: this.rules,
|
|
@@ -493,12 +504,38 @@ export default {
|
|
|
},
|
|
|
openEdit(index, sitem) {
|
|
|
this.modelIndex = index;
|
|
|
- this.sitem = sitem;
|
|
|
- this.showModel = true;
|
|
|
+ this.modelSitem = sitem;
|
|
|
+ this.showOtherModel = true;
|
|
|
},
|
|
|
openDelete(index) {
|
|
|
this.spec_tableData.splice(index, 1);
|
|
|
},
|
|
|
+ //规格编辑修改结果
|
|
|
+ refreshEdit(e) {
|
|
|
+ let item = JSON.parse(JSON.stringify(e));
|
|
|
+ const {
|
|
|
+ index,
|
|
|
+ id,
|
|
|
+ spec_id,
|
|
|
+ spec_value,
|
|
|
+ spec_value_id,
|
|
|
+ spec_value_value,
|
|
|
+ } = item;
|
|
|
+ if (index + "" === "-1") {
|
|
|
+ this.spec_tableData.push(item);
|
|
|
+ } else {
|
|
|
+ this.spec_tableData.forEach((i, findex) => {
|
|
|
+ if (i.spec_id === spec_id) {
|
|
|
+ this.spec_tableData[findex].id = id;
|
|
|
+ this.spec_tableData[findex].spec_id = spec_id;
|
|
|
+ this.spec_tableData[findex].spec_value = spec_value;
|
|
|
+ this.spec_tableData[findex].spec_value_id = spec_value_id;
|
|
|
+ this.spec_tableData[findex].spec_value_value = spec_value_value;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.showOtherModel = false;
|
|
|
+ },
|
|
|
async resetForm() {
|
|
|
this.spec_tableData = [];
|
|
|
this.old_spec_tableData = [];
|
|
@@ -544,10 +581,17 @@ export default {
|
|
|
p_arrtime,
|
|
|
} = this.sitem;
|
|
|
this.unit_name = unit_name || "";
|
|
|
- console.log(fi, p_pgNo);
|
|
|
+ console.log(p_cat_info);
|
|
|
+ let asd = [];
|
|
|
+ if (p_cat_info && p_cat_info.length > 0) {
|
|
|
+ p_cat_info.forEach((sd) => {
|
|
|
+ asd.push(sd.id);
|
|
|
+ });
|
|
|
+ }
|
|
|
this.ruleForm = {
|
|
|
p_cat_info: p_cat_info,
|
|
|
p_cat_id: p_cat_id,
|
|
|
+ p_cat_arr_id: asd,
|
|
|
p_budget_price: p_budget_price,
|
|
|
p_pgNo: p_pgNo,
|
|
|
p_num: p_num,
|
|
@@ -562,7 +606,8 @@ export default {
|
|
|
fi === "-1" && p_pgNo ? p_budget_price : budget_price || "0.00",
|
|
|
num: fi === "-1" && p_pgNo ? p_num : num || "0",
|
|
|
brand_id: brand_id ? [brand_id] : [],
|
|
|
- cat_id: fi === "-1" && p_pgNo ? p_cat_id : cat_id ? cat_id : [],
|
|
|
+ cat_id: [],
|
|
|
+ cat_arr_id: [],
|
|
|
good_img: fi === "-1" && p_pgNo ? p_good_img : good_img || "",
|
|
|
good_name: fi === "-1" && p_pgNo ? p_good_name : good_name || "",
|
|
|
total_weight: total_weight || "0",
|
|
@@ -576,7 +621,7 @@ export default {
|
|
|
use_desc: use_desc || "",
|
|
|
remark: remark || "",
|
|
|
metal_id: metal_id || "",
|
|
|
- gold_price: gold_price || "",
|
|
|
+ gold_price: gold_price || "0",
|
|
|
unit: unit ? [unit] : [],
|
|
|
};
|
|
|
}
|
|
@@ -584,59 +629,53 @@ export default {
|
|
|
},
|
|
|
//商品分类选择
|
|
|
async goods_class_change(e) {
|
|
|
- const { code, pid, id, label } = e;
|
|
|
+ console.log(e);
|
|
|
+ const { code, pid, id, label, item } = e;
|
|
|
this.ruleForm.cat_id = id ? [id] : [];
|
|
|
+ this.ruleForm.cat_arr_id = item;
|
|
|
this.$refs.ruleForm.validateField("cat_id");
|
|
|
this.is_noble = pid === "6";
|
|
|
},
|
|
|
|
|
|
//单位选择
|
|
|
unitsearchChange(e) {
|
|
|
- const { id, code, label } = e;
|
|
|
- if (id) {
|
|
|
- this.ruleForm.unit = [code];
|
|
|
- } else {
|
|
|
- this.ruleForm.unit = [];
|
|
|
- }
|
|
|
+ const { code } = e;
|
|
|
+ this.ruleForm.unit = code ? [code] : [];
|
|
|
this.$refs.ruleForm.validateField("unit");
|
|
|
},
|
|
|
- //预算单价
|
|
|
- budget_price_change(e) {
|
|
|
- this.ruleForm.budget_price = e + "";
|
|
|
- this.$refs.ruleForm.validateField("budget_price");
|
|
|
- },
|
|
|
//购买数量
|
|
|
- num_change(e) {
|
|
|
- this.ruleForm.num = e + "";
|
|
|
- this.$refs.ruleForm.validateField("num");
|
|
|
+ num_change(e, key) {
|
|
|
+ this.ruleForm[key] = e + "";
|
|
|
+ this.$refs.ruleForm.validateField(key);
|
|
|
},
|
|
|
//品牌选择
|
|
|
brand_id_searchChange(e) {
|
|
|
- const { id, code, label } = e;
|
|
|
- if (id) {
|
|
|
- this.ruleForm.brand_id = [id];
|
|
|
- } else {
|
|
|
- this.ruleForm.brand_id = [];
|
|
|
- }
|
|
|
+ const { id } = e;
|
|
|
+ this.ruleForm.brand_id = id ? [id] : [];
|
|
|
this.$refs.ruleForm.validateField("brand_id");
|
|
|
},
|
|
|
- //商品总重量
|
|
|
- total_weight_change(e) {
|
|
|
- this.ruleForm.total_weight = e + "";
|
|
|
- this.$refs.ruleForm.validateField("total_weight");
|
|
|
- },
|
|
|
- //金属克重
|
|
|
- specs_weight_change(e) {
|
|
|
- this.ruleForm.specs_weight = e + "";
|
|
|
- this.$refs.ruleForm.validateField("specs_weight");
|
|
|
+ //贵金属种类选择
|
|
|
+ noble_metalsearchChange(e) {
|
|
|
+ const { id, price } = e;
|
|
|
+ this.ruleForm.metal_id = id ? id : "";
|
|
|
+ this.$refs.ruleForm.validateField("noble_metal");
|
|
|
+ this.ruleForm.gold_price = price ? price : "0";
|
|
|
+ this.$refs.ruleForm.validateField("gold_price");
|
|
|
},
|
|
|
async submitForm() {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ const { total_weight, specs_weight, p_cat_info } = model;
|
|
|
+ if (total_weight * 1000 < specs_weight * 1000) {
|
|
|
+ this.$message.warning("商品总重量不能小于贵金属重量!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
model.index = this.findex;
|
|
|
-
|
|
|
+ model.speclist = JSON.parse(JSON.stringify(this.spec_tableData));
|
|
|
+ this.loading = false;
|
|
|
this.showModelThis = false;
|
|
|
// 刷新
|
|
|
this.$emit("refresh", model);
|