|
@@ -5,7 +5,7 @@
|
|
|
:center="true"
|
|
|
align="left"
|
|
|
top="10vh"
|
|
|
- width="750px"
|
|
|
+ width="900px"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="showModelThis"
|
|
|
element-loading-text="拼命加载中"
|
|
@@ -20,42 +20,67 @@
|
|
|
status-icon
|
|
|
:size="'mini'"
|
|
|
:rules="rulesThis"
|
|
|
- label-width="80px"
|
|
|
+ label-width="75px"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="商品名称:">
|
|
|
- <el-input v-model="sitem.good_name" disabled />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
<el-col :span="3">
|
|
|
- <el-form-item label="图片:" style="margin: 0" label-width="44px">
|
|
|
+ <el-form-item label="图片" style="margin: 0" label-width="44px">
|
|
|
<img
|
|
|
class="hover"
|
|
|
v-viewer
|
|
|
- :src="sitem.good_img"
|
|
|
+ :src="show_sitem.good_img"
|
|
|
alt=""
|
|
|
- v-if="sitem.good_img"
|
|
|
+ v-if="show_sitem && show_sitem.good_img"
|
|
|
style="width: 35px; height: 35px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-form-item label="单位:" label-width="50px">
|
|
|
- <el-input v-model="sitem.unit" disabled />
|
|
|
+ <el-form-item label="单位" label-width="50px">
|
|
|
+ <el-input v-if="show_sitem" v-model="show_sitem.unit" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="17">
|
|
|
+ <el-form-item label="商品名称">
|
|
|
+ <el-input
|
|
|
+ v-if="show_sitem"
|
|
|
+ v-model="show_sitem.good_name"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ label="议价原因"
|
|
|
+ prop="result_info_id"
|
|
|
+ label-width="88px"
|
|
|
+ >
|
|
|
+ <abnormal-cause
|
|
|
+ :value="ruleForm.result_info_id"
|
|
|
+ :placeholder="'议价原因'"
|
|
|
+ :type="'7'"
|
|
|
+ :disabled="false"
|
|
|
+ :size="'mini'"
|
|
|
+ @searchChange="select_change"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
<el-col :span="7">
|
|
|
- <el-form-item label="当前售价:">
|
|
|
- <el-input v-model="sitem.sale_price" disabled />
|
|
|
+ <el-form-item label="当前售价">
|
|
|
+ <el-input
|
|
|
+ v-if="show_sitem"
|
|
|
+ v-model="show_sitem.sale_price"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
+ <el-col :span="9">
|
|
|
<el-form-item
|
|
|
- label="期望售价:"
|
|
|
+ label="期望售价"
|
|
|
prop="bargain_price"
|
|
|
- label-width="95px"
|
|
|
+ label-width="88px"
|
|
|
>
|
|
|
<digital-input
|
|
|
:values="ruleForm.bargain_price"
|
|
@@ -73,15 +98,25 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="型号:" style="margin: 0">
|
|
|
- <span v-for="(si, sii) in sitem.specinfo" :key="sii + 'spec'"
|
|
|
- ><span v-if="sii !== 0">--</span>
|
|
|
- <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
|
|
|
- </span>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item
|
|
|
+ label="议价备注:"
|
|
|
+ prop="bargain_remark"
|
|
|
+ label-width="88px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ placeholder="议价备注"
|
|
|
+ v-model="ruleForm.bargain_remark"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="text-align: right">
|
|
|
+ <el-col :span="6" style="text-align: right">
|
|
|
+ <el-button @click="showModelThis = false" :size="'mini'">{{
|
|
|
+ isDetail ? "关 闭" : "取 消"
|
|
|
+ }}</el-button>
|
|
|
<el-button
|
|
|
v-if="!isDetail"
|
|
|
type="primary"
|
|
@@ -89,9 +124,6 @@
|
|
|
@click="submitForm"
|
|
|
>保 存
|
|
|
</el-button>
|
|
|
- <el-button @click="showModelThis = false" :size="'mini'">{{
|
|
|
- isDetail ? "关 闭" : "取 消"
|
|
|
- }}</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -128,10 +160,21 @@ export default {
|
|
|
organizeList: [],
|
|
|
showModelThis: this.showModel,
|
|
|
ruleForm: {
|
|
|
+ result_info_id: "",
|
|
|
bargain_price: "0",
|
|
|
+ result_info_id_name: "",
|
|
|
+ bargain_remark: "",
|
|
|
},
|
|
|
+ show_sitem: null,
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
+ result_info_id: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择议价原因!",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
bargain_price: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -139,6 +182,13 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
+ bargain_remark: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "议价备注不能为空!",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
};
|
|
|
},
|
|
@@ -176,21 +226,40 @@ export default {
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
- const { sale_price } = this.sitem;
|
|
|
+ this.show_sitem = JSON.parse(JSON.stringify(this.sitem));
|
|
|
+ const { sale_price, specinfo } = this.sitem;
|
|
|
+ if (specinfo && specinfo.length > 0) {
|
|
|
+ specinfo.forEach((a, ai) => {
|
|
|
+ this.show_sitem.good_name += `${ai === 0 ? "_" : "-"}${
|
|
|
+ a.spec_name
|
|
|
+ }[${a.spec_value_name}]`;
|
|
|
+ });
|
|
|
+ }
|
|
|
if (this.$refs.ruleForm) {
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
this.ruleForm = {
|
|
|
bargain_price: sale_price || "0",
|
|
|
+ result_info_id: "",
|
|
|
+ bargain_remark: "",
|
|
|
+ result_info_id_name: "",
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ select_change(e) {
|
|
|
+ const { code, label } = e;
|
|
|
+ this.ruleForm.result_info_id = code || "";
|
|
|
+ this.ruleForm.result_info_id_name = label || "";
|
|
|
+ this.$refs.ruleForm.validateField("result_info_id");
|
|
|
+ },
|
|
|
async submitForm() {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
- const { bargain_price } = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ const { bargain_price, result_info_id, bargain_remark } = JSON.parse(
|
|
|
+ JSON.stringify(this.ruleForm)
|
|
|
+ );
|
|
|
const { bidNo, sale_price } = this.sitem;
|
|
|
if (sale_price * 100 === bargain_price * 100) {
|
|
|
this.$message.warning("期望售价不能等于当前售价!");
|
|
@@ -200,6 +269,8 @@ export default {
|
|
|
const model = {
|
|
|
bidNo: bidNo,
|
|
|
bargain_price: bargain_price, // 账号
|
|
|
+ result_info_id,
|
|
|
+ bargain_remark,
|
|
|
};
|
|
|
let res = await asyncRequest.bargain_add(model);
|
|
|
this.loading = false;
|