油批
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.1 KiB

2 years ago
<template>
<el-dialog
title="调价"
:visible="controlWindows.adjust"
width="30%"
:before-close="closeWindow"
@opened="openDrawer"
>
<div class="adjust">
<el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="成本价" prop="floorPrice">
<el-input
maxlength="50"
v-checkNum
v-model="form.floorPrice"
placeholder="请输入成本价"
></el-input>
</el-form-item>
<el-form-item label="企业销售价" prop="salePrice2company">
<el-input
maxlength="50"
v-checkNum
v-model="form.salePrice2company"
placeholder="请输入企业销售价"
></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="controlWindows.adjust = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import serve from "api/product.js";
export default {
props: {
controlWindows: Object,
},
data() {
return {
form: {},
rules: {
floorPrice: [
{ required: true, message: "请输入成本价", trigger: "blur" },
],
salePrice2company: [
2 years ago
{ required: true, message: "请输入企业销售价", trigger: "blur" },
2 years ago
],
},
};
},
methods: {
openDrawer() {},
submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
Object.assign(this.form, this.controlWindows.addInfo);
serve.modifyPrice(this.form).then((res) => {
this.$message.success(res.msg);
this.closeWindow();
});
}
});
},
closeWindow() {
this.form = {};
this.$emit("closeWindow");
2 years ago
this.$nextTick(() => {
this.$refs.form.clearValidate();
this.controlWindows.adjust = false;
});
2 years ago
},
},
};
</script>
<style lang="scss" scoped>
.adjust {
.el-input {
width: 200px;
}
}
</style>