|
@@ -184,7 +184,7 @@
|
|
|
<el-form-item label="套餐标题" prop="title">
|
|
|
<el-input v-model="form.title" placeholder="请输入套餐标题" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所属分类" props="cateId">
|
|
|
+ <el-form-item label="所属分类" prop="cateId">
|
|
|
<el-select style="width: 200px" v-model="form.cateId" placeholder="请选择分类" clearable size="small" >
|
|
|
<el-option
|
|
|
v-for="item in cateOptions"
|
|
@@ -194,6 +194,16 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="所属公司" prop="companyId">
|
|
|
+ <el-select style="width: 240px" v-model="form.companyId" placeholder="请选择企业" clearable size="small" @change="handleCompanyChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in companyOptions"
|
|
|
+ :key="item.companyId"
|
|
|
+ :label="item.companyName"
|
|
|
+ :value="item.companyId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="套餐描述" prop="descs">
|
|
|
<el-input type="textarea" v-model="form.descs" placeholder="请输入描述" />
|
|
|
</el-form-item>
|
|
@@ -294,7 +304,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog :title="product.title" v-if="product.open" :visible.sync="product.open" width="1000px" append-to-body>
|
|
|
- <product-attr-value-select ref="product" @selectProduct="selectProduct" />
|
|
|
+ <product-attr-value-select ref="product" @selectProduct="selectProduct" :company-id="form.companyId"/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -305,6 +315,7 @@ import Editor from '@/components/Editor/wang';
|
|
|
import productAttrValueSelect from "../components/productAttrValueSelect";
|
|
|
import Material from '@/components/Material'
|
|
|
import singleImg from '@/components/Material/single'
|
|
|
+import {getCompanyList} from "@/api/company/company";
|
|
|
export default {
|
|
|
name: "StoreProductPackage",
|
|
|
components: {
|
|
@@ -323,6 +334,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ companyOptions: [],
|
|
|
statusOptions:[],
|
|
|
cateOptions:[],
|
|
|
photoArr:[],
|
|
@@ -370,7 +382,9 @@ export default {
|
|
|
companyUserId: null
|
|
|
},
|
|
|
// 表单参数
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ companyId: null
|
|
|
+ },
|
|
|
// 表单参数
|
|
|
form1: {},
|
|
|
// 表单校验
|
|
@@ -419,8 +433,22 @@ export default {
|
|
|
this.storePayTypeOptions = response.data;
|
|
|
});
|
|
|
this.getList();
|
|
|
+
|
|
|
+ this.getCompanyList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleCompanyChange(){
|
|
|
+ // 清除套餐商品
|
|
|
+ this.products = [];
|
|
|
+ },
|
|
|
+ /** 获取公司下拉列表*/
|
|
|
+ getCompanyList() {
|
|
|
+ this.loading = true;
|
|
|
+ getCompanyList().then(response => {
|
|
|
+ this.companyOptions = response.data;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
handleProductCountChange(row){
|
|
|
row.money=row.count*row.price;
|
|
|
this.$forceUpdate();
|
|
@@ -449,8 +477,13 @@ export default {
|
|
|
row.money=row.count*row.price;
|
|
|
this.products.push(row);
|
|
|
this.compute();
|
|
|
+ this.$message.success("商品已添加!");
|
|
|
},
|
|
|
handleAddProduct(){
|
|
|
+ if(!this.form.companyId) {
|
|
|
+ this.$message.error("请选择套餐所属公司!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.product.open=true;
|
|
|
// setTimeout(() => {
|
|
|
// this.$refs.product.getData(1);
|