|
|
@@ -292,29 +292,28 @@
|
|
|
<!-- 添加或修改商品信息管理对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" style="display:flex;flex-wrap:wrap;justify-content:space-around;">
|
|
|
- <el-form-item :label="$t('table.commodityType')" prop="typeId" style="width:500px">
|
|
|
- <el-select :disabled='!isDetail' v-model="form.typeId" :placeholder="$t('placeholder.commodityType')" >
|
|
|
- <el-option
|
|
|
- v-for="item,index in commodityTypeList"
|
|
|
- :key="index"
|
|
|
- :label="item.typeName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item :label="$t('table.commodityName')" prop="commodityName" style="width:500px">
|
|
|
- <el-input :disabled='!isDetail' v-model="form.commodityName" :placeholder="$t('placeholder.commodityName')" />
|
|
|
+ <el-form-item :label="$t('table.commodityType')" prop="typeSelected" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
+ <el-checkbox-group v-model="form.typeSelected" :disabled='!isDetail'>
|
|
|
+ <el-checkbox
|
|
|
+ v-for="item,index in commodityTypeList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.id">{{ item.typeName }}
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('table.departurePlace')" prop="departurePlace" style="width:500px">
|
|
|
+ <el-form-item :label="$t('table.commodityName')" prop="commodityName" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
+ <el-input :disabled='!isDetail' v-model="form.commodityName" type="textarea" :placeholder="$t('placeholder.commodityName')" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('table.departurePlace')" prop="departurePlace" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
<el-input :disabled='!isDetail' v-model="form.departurePlace" type="text" :placeholder="$t('placeholder.departurePlace')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('table.adultPrice')" prop="adultPrice" style="width:500px">
|
|
|
+ <el-form-item :label="$t('table.adultPrice')" prop="adultPrice" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
<el-input :disabled='!isDetail' v-model="form.adultPrice" :placeholder="$t('placeholder.adultPrice')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('table.childPrice')" prop="childPrice" style="width:500px">
|
|
|
+ <el-form-item :label="$t('table.childPrice')" prop="childPrice" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
<el-input :disabled='!isDetail' v-model="form.childPrice" :placeholder="$t('placeholder.childPrice')" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('table.stock')" prop="stock" style="width:500px">
|
|
|
+ <el-form-item :label="$t('table.stock')" prop="stock" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
<el-input :disabled='!isDetail' v-model="form.stock" :placeholder="$t('placeholder.stock')" />
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="$t('dialog.childPriceExplain')" prop="childPriceExplain" label-width="160px" style="width:800px;margin-right:270px">
|
|
|
@@ -326,11 +325,11 @@
|
|
|
<el-form-item :label="$t('dialog.commodityImg')" label-width="160px" style="width:800px;margin-right:270px" prop='commodityImg'>
|
|
|
<image-upload v-model="form.commodityImg" :limit='5'/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('dialog.isCoupon')" label-width="250px" style="width:800px;margin-right:270px">
|
|
|
+ <el-form-item :label="$t('dialog.isCoupon')" label-width="250px" style="width:800px;margin-right:270px">
|
|
|
<el-radio-group :disabled='!isDetail' v-model="form.isCoupon">
|
|
|
- <el-radio :label="'1'">{{$t('dialog.yes')}}</el-radio>
|
|
|
- <el-radio :label="'0'">{{$t('dialog.no')}}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-radio :label="'1'">{{$t('dialog.yes')}}</el-radio>
|
|
|
+ <el-radio :label="'0'">{{$t('dialog.no')}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-row v-if="form.isCoupon" class="mb8" :gutter="10" style="width:800px;margin-right:270px;margin-bottom:40px">
|
|
|
<!-- <el-col :span="1.5">
|
|
|
@@ -506,24 +505,6 @@
|
|
|
<div v-else v-html="form.remark" ></div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!-- <el-form-item label="购买数量" prop="saleNum">
|
|
|
- <el-input v-model="form.saleNum" placeholder="请输入购买数量" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="是否推荐:0-否 1-是" prop="isRecommend">
|
|
|
- <el-input v-model="form.isRecommend" placeholder="请输入是否推荐:0-否 1-是" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="是否优选:0-否 1-是" prop="isPreferred">
|
|
|
- <el-input v-model="form.isPreferred" placeholder="请输入是否优选:0-否 1-是" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="bus公司id" prop="deptId">
|
|
|
- <el-input v-model="form.deptId" placeholder="请输入bus公司id" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="删除标志:0-正常 1-删除" prop="delFlag">
|
|
|
- <el-input v-model="form.delFlag" placeholder="请输入删除标志:0-正常 1-删除" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
- </el-form-item> -->
|
|
|
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -618,42 +599,23 @@ export default {
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- isDetail: true,
|
|
|
+ isDetail: true,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- typeId: null,
|
|
|
- isRecommend: null,
|
|
|
+ typeId: null,
|
|
|
+ isRecommend: null,
|
|
|
isPreferred: null,
|
|
|
'params[beginDate]':null,
|
|
|
'params[endDate]':null,
|
|
|
|
|
|
- // periodStart: null,
|
|
|
- // periodEnd: null,
|
|
|
- // commodityName: null,
|
|
|
- // departurePlace: null,
|
|
|
- // adultPrice: null,
|
|
|
- // childPrice: null,
|
|
|
- // stock: null,
|
|
|
- // childPriceExplain: null,
|
|
|
- // faceImg: null,
|
|
|
- // commodityImg: null,
|
|
|
- // isCoupon: null,
|
|
|
- // periodWeek: null,
|
|
|
- // targetPeopleNum: null,
|
|
|
- // advancePeriod: null,
|
|
|
- // attention: null,
|
|
|
- // specification: null,
|
|
|
- // saleNum: null,
|
|
|
- // status: null,
|
|
|
- // deptId: null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- typeId: [
|
|
|
+ typeSelected: [
|
|
|
{ required: true, message: this.$t('rules.typeId'), trigger: "change" }
|
|
|
],
|
|
|
commodityName: [
|
|
|
@@ -721,6 +683,9 @@ export default {
|
|
|
});
|
|
|
listCommodityType().then(response => {
|
|
|
this.commodityTypeList = response.rows;
|
|
|
+ for(let i=0;i<this.commodityTypeList.length;i++){
|
|
|
+ this.commodityTypeList[i].id = this.commodityTypeList[i].id.toString(10);
|
|
|
+ }
|
|
|
// this.total = response.total;
|
|
|
// this.loading = false;
|
|
|
});
|
|
|
@@ -735,6 +700,7 @@ export default {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
typeId: null,
|
|
|
+ typeSelected: [],
|
|
|
commodityName: null,
|
|
|
departurePlace: null,
|
|
|
adultPrice: null,
|
|
|
@@ -805,10 +771,10 @@ export default {
|
|
|
// this.resetForm("queryForm");
|
|
|
this.queryParams = {
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 10,
|
|
|
typeId: null,
|
|
|
isRecommend: null,
|
|
|
- isPreferred: null,
|
|
|
+ isPreferred: null,
|
|
|
'params[beginDate]':null,
|
|
|
'params[endDate]':null,
|
|
|
}
|
|
|
@@ -835,15 +801,26 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getCommodity(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
- if(this.form.periodWeek.indexOf(',')>0){
|
|
|
- this.form.periodWeek = this.form.periodWeek.split(",");
|
|
|
- }else{
|
|
|
- this.form.periodWeek = [this.form.periodWeek]
|
|
|
- }
|
|
|
- this.tCommodityJourneyInformationList = response.data.commodityJourneyInformationList;
|
|
|
- this.tCommodityCouponList = response.data.commodityCouponList;
|
|
|
- this.open = true;
|
|
|
- this.title = this.$t('dialog.CommodityTitel2');
|
|
|
+ if(this.form.periodWeek.indexOf(',')>0){
|
|
|
+
|
|
|
+ this.form.periodWeek = this.form.periodWeek.split(",");
|
|
|
+ }else{
|
|
|
+ this.form.periodWeek = [this.form.periodWeek]
|
|
|
+ }
|
|
|
+ if(this.form.typeSelected.indexOf(',')>0){
|
|
|
+ this.form.typeSelected = this.form.typeSelected.split(",");
|
|
|
+ // let newArray = [];
|
|
|
+ // for (let j=0;j<stri.length; j++){
|
|
|
+ // newArray.push(stri[j]);
|
|
|
+ // }
|
|
|
+ // this.form.typeSelected = newArray;
|
|
|
+ }else{
|
|
|
+ this.form.typeSelected = [this.form.typeSelected]
|
|
|
+ }
|
|
|
+ this.tCommodityJourneyInformationList = response.data.commodityJourneyInformationList;
|
|
|
+ this.tCommodityCouponList = response.data.commodityCouponList;
|
|
|
+ this.open = true;
|
|
|
+ this.title = this.$t('dialog.CommodityTitel2');
|
|
|
});
|
|
|
},
|
|
|
handleDetail(row){
|
|
|
@@ -852,15 +829,20 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getCommodity(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
- if(this.form.periodWeek.indexOf(',')>0){
|
|
|
- this.form.periodWeek = this.form.periodWeek.split(",");
|
|
|
- }else{
|
|
|
- this.form.periodWeek = [this.form.periodWeek]
|
|
|
- }
|
|
|
- this.tCommodityJourneyInformationList = response.data.commodityJourneyInformationList;
|
|
|
- this.tCommodityCouponList = response.data.commodityCouponList;
|
|
|
- this.open = true;
|
|
|
- this.title = this.$t('dialog.CommodityTitel3');
|
|
|
+ if(this.form.periodWeek.indexOf(',')>0){
|
|
|
+ this.form.periodWeek = this.form.periodWeek.split(",");
|
|
|
+ }else{
|
|
|
+ this.form.periodWeek = [this.form.periodWeek]
|
|
|
+ }
|
|
|
+ if(this.form.typeSelected.indexOf(',')>0){
|
|
|
+ this.form.typeSelected = this.form.typeSelected.split(",");
|
|
|
+ }else{
|
|
|
+ this.form.typeSelected = [this.form.typeSelected]
|
|
|
+ }
|
|
|
+ this.tCommodityJourneyInformationList = response.data.commodityJourneyInformationList;
|
|
|
+ this.tCommodityCouponList = response.data.commodityCouponList;
|
|
|
+ this.open = true;
|
|
|
+ this.title = this.$t('dialog.CommodityTitel3');
|
|
|
});
|
|
|
},
|
|
|
statusUpdate(row,val){
|
|
|
@@ -896,9 +878,9 @@ export default {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.form.periodWeek = this.form.periodWeek.join(",");
|
|
|
- console.log(this.form.periodWeek)
|
|
|
+ this.form.typeSelected = this.form.typeSelected.join(",");
|
|
|
this.form.commodityJourneyInformationList = this.tCommodityJourneyInformationList ;
|
|
|
- this.form.commodityCouponList = this.tCommodityCouponList;
|
|
|
+ this.form.commodityCouponList = this.tCommodityCouponList;
|
|
|
if (this.form.id != null) {
|
|
|
updateCommodity(this.form).then(response => {
|
|
|
this.$modal.msgSuccess(this.$t('message.success1'));
|