上架修改
This commit is contained in:
parent
238d9edb4a
commit
54573b6cb9
|
|
@ -6,28 +6,25 @@
|
|||
<block slot="content">服务上架</block>
|
||||
</cu-custom>
|
||||
<!-- 表单内容 -->
|
||||
<form @submit="submit">
|
||||
<form @submit="submit" style="position: relative; z-index: 1;">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">服务名称<text class="text-red">*</text></view>
|
||||
<input name="servName" v-model="formData.servName" placeholder="请编辑上架标题(供客户搜索)"></input>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="title">关键词<text class="text-red">*</text></view>
|
||||
<view class="title">搜索关键词<text class="text-red">*</text></view>
|
||||
<input name="servDesc" v-model="formData.servDesc" placeholder="多个关键词用#分隔"></input>
|
||||
</view>
|
||||
<view class="solid-top">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">选择类目<text class="text-red">*</text></view>
|
||||
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
|
||||
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
||||
<input v-if="formData.category"
|
||||
disabled class="line-input radius-input"
|
||||
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
|
||||
placeholder="请选择类目" />
|
||||
<input v-else-if="formData.categoryConcatName"
|
||||
disabled class="line-input radius-input"
|
||||
:value="formData.categoryConcatName"
|
||||
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
||||
<input v-if="formData.category" disabled class="line-input radius-input"
|
||||
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
|
||||
placeholder="请选择类目" />
|
||||
<input v-else-if="formData.categoryConcatName" disabled class="line-input radius-input"
|
||||
:value="formData.categoryConcatName" placeholder="请选择类目" />
|
||||
</picker>
|
||||
</view>
|
||||
<view v-if="formData.specsList && formData.specsList.length > 0">
|
||||
|
|
@ -48,12 +45,14 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="flex margin-top-xs">
|
||||
<view class="margin-right-xs">
|
||||
<view class='text-red' style="position: absolute;">*</view>
|
||||
<zb-tooltip :content="'平' + parseInt(item.deptRate * 100) + '%+¥' + $calcUtil.curNumPlaces(item.deptMoney, 3) + '销' + parseInt((Number(item.oneRate) + Number(item.twoRate) + Number(item.threeRate) + Number(item.retainRate)) * 100) + '%+¥' + $calcUtil.curNumPlaces(item.retainMoney, 3)"
|
||||
<view class="margin-right-xs">
|
||||
<view class='text-red' style="position: absolute; z-index: 0;">*</view>
|
||||
<zb-tooltip
|
||||
:content="'平' + parseInt(item.deptRate * 100) + '%+¥' + $calcUtil.curNumPlaces(item.deptMoney, 3) + '销' + parseInt((Number(item.oneRate) + Number(item.twoRate) + Number(item.threeRate) + Number(item.retainRate)) * 100) + '%+¥' + $calcUtil.curNumPlaces(item.retainMoney, 3)"
|
||||
placement="right" ref="goodsPriceTip">
|
||||
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsPrice')"
|
||||
:value="item.goodsPrice" placeholder="价格" @blur="hideTips('goodsPriceTip', index)"></input>
|
||||
:value="item.goodsPrice" placeholder="价格"
|
||||
@blur="hideTips('goodsPriceTip', index)"></input>
|
||||
</zb-tooltip>
|
||||
</view>
|
||||
<view class="margin-right-xs" style="flex-basis: 21%;">
|
||||
|
|
@ -68,8 +67,8 @@
|
|||
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsUnit')"
|
||||
:value="item.goodsUnit" placeholder="单位"></input>
|
||||
</view>
|
||||
<view style="flex-basis: 14%;">
|
||||
<view class='text-red' style="position: absolute;">*</view>
|
||||
<view style="flex-basis: 14%;">
|
||||
<view class='text-red' style="position: absolute; absolute; z-index: 0;">*</view>
|
||||
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsNum')"
|
||||
:value="item.goodsNum" placeholder="库存数"></input>
|
||||
</view>
|
||||
|
|
@ -107,33 +106,33 @@
|
|||
<!-- </view> -->
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
<view class="cu-form-group solid-top justify-start">
|
||||
<view class="title">商品单位<text class="text-red">*</text></view>
|
||||
<my-uni-combox class="form-val-area" :candidates="goodsUnitList" placeholder="上方已填单位则以上方所填为准"
|
||||
v-model="formData.goodsUnit">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="cu-form-group justify-start">
|
||||
<view class="title">质保期</view>
|
||||
<my-uni-combox class="form-val-area" :candidates="warrantyPeriodList" placeholder="请选择"
|
||||
v-model="formData.warrantyPeriod">
|
||||
</my-uni-combox>
|
||||
<view class="cu-form-group solid-top justify-start">
|
||||
<view class="title">商品单位<text class="text-red">*</text></view>
|
||||
<my-uni-combox class="form-val-area" :candidates="goodsUnitList" placeholder="上方已填单位则以上方所填为准"
|
||||
v-model="formData.goodsUnit">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="cu-form-group justify-start">
|
||||
<view class="title">质保期<text class="text-red">*</text></view>
|
||||
<my-uni-combox class="form-val-area" :candidates="warrantyPeriodList" placeholder="请选择"
|
||||
v-model="formData.warrantyPeriod">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="cu-form-group justify-start">
|
||||
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
||||
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
||||
<view class="title">服务活动</view>
|
||||
<view class="title">服务活动<text class="text-red">*</text></view>
|
||||
<my-uni-combox class="form-val-area" :candidates="servActivityList" placeholder="请选择"
|
||||
v-model="formData.servActivity">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="cu-form-group justify-start">
|
||||
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
||||
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
||||
<view class="title">服务时效</view>
|
||||
<my-uni-combox class="form-val-area" :candidates="expectDurationList" placeholder="请选择"
|
||||
v-model="formData.expectDuration">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="cu-form-group justify-start">
|
||||
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
||||
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
||||
<view class="title">服务时效<text class="text-red">*</text></view>
|
||||
<my-uni-combox class="form-val-area" :candidates="expectDurationList" placeholder="请选择"
|
||||
v-model="formData.expectDuration">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="solid-top">
|
||||
<view class="cu-form-group">
|
||||
|
|
@ -142,10 +141,9 @@
|
|||
:value="regionMultiIndex" :range-key="'areaName'" :range="regionList">
|
||||
<input disabled class="line-input radius-input" v-if="formData.region"
|
||||
:value="formData.region && formData.region.length ? formData.region[0].areaName + '-' + formData.region[1].areaName : ''"
|
||||
placeholder="请选择区域"></input>
|
||||
<input disabled class="line-input radius-input" v-else-if="formData.areaConcatName"
|
||||
:value="formData.areaConcatName"
|
||||
placeholder="请选择区域"></input>
|
||||
<input disabled class="line-input radius-input" v-else-if="formData.areaConcatName"
|
||||
:value="formData.areaConcatName" placeholder="请选择区域"></input>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="padding-lr bg-white">
|
||||
|
|
@ -160,52 +158,55 @@
|
|||
</view>
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action text-black">区域描述<text class="text-red">*</text></view>
|
||||
</view>
|
||||
<view class="padding-lr-sm padding-bottom-sm bg-white">
|
||||
<textarea name="areaDesc" style="width: 100%; height: 150rpx;" class="solid radius text-left padding-sm"
|
||||
v-model="formData.areaDesc" maxlength="-1" placeholder="如:XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
|
||||
</view>
|
||||
<!-- 多城市 -->
|
||||
<view v-for="(item,index) in servArea" class="bg-white">
|
||||
<view class="solid-top">
|
||||
<view @click="delServArea(index)">
|
||||
<button class="cu-btn bg-red light">
|
||||
<text class="margin-right-xs"><text class="cuIcon-close"></text></text>
|
||||
<text>删除</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="title">上架区域<text class="text-red">*</text></view>
|
||||
<picker :mode="'multiSelector'" @change="multiRegionChange($event, index)" @columnchange="multiRegionColChange($event, index)"
|
||||
:value="servArea[index].regionMultiIndex" :range-key="'areaName'" :range="servArea[index].regionList">
|
||||
<input disabled class="line-input radius-input" v-if="servArea[index].region"
|
||||
:value="servArea[index].region && servArea[index].region.length ? servArea[index].region[0].areaName + '-' + servArea[index].region[1].areaName : ''"
|
||||
placeholder="请选择区域"></input>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="padding-lr bg-white">
|
||||
<checkbox-group @change="multiAreaCheckDistirct($event, index)" class="grid col-3">
|
||||
<view v-for="(item, index1) in servArea[index].districtList" class="margin-tb-xs">
|
||||
<checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="index1"
|
||||
:checked="item.checked"></checkbox>
|
||||
<text>{{item.areaName}}</text>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar">
|
||||
<view class="action text-black">区域描述<text class="text-red">*</text></view>
|
||||
</view>
|
||||
<view class="padding-lr-sm padding-bottom-sm">
|
||||
<textarea name="areaDesc" style="width: 100%; height: 150rpx;" class="solid radius text-left padding-sm"
|
||||
v-model="servArea[index].areaDesc" maxlength="-1" placeholder="如:XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-center padding-bottom bg-white">
|
||||
<button class="cu-btn bg-main-color light" @click="addServArea">
|
||||
<text class="margin-right-xs"><text class="cuIcon-add"></text></text>
|
||||
<text>继续添加上架城市</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="padding-lr-sm padding-bottom-sm bg-white">
|
||||
<textarea name="areaDesc" style="width: 100%; height: 150rpx;" class="solid radius text-left padding-sm"
|
||||
v-model="formData.areaDesc" maxlength="-1" placeholder="如:XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
|
||||
</view>
|
||||
<!-- 多城市 -->
|
||||
<view v-for="(item,index) in servArea" class="bg-white">
|
||||
<view class="solid-top">
|
||||
<view @click="delServArea(index)">
|
||||
<button class="cu-btn bg-red light">
|
||||
<text class="margin-right-xs"><text class="cuIcon-close"></text></text>
|
||||
<text>删除</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="title">上架区域<text class="text-red">*</text></view>
|
||||
<picker :mode="'multiSelector'" @change="multiRegionChange($event, index)"
|
||||
@columnchange="multiRegionColChange($event, index)"
|
||||
:value="servArea[index].regionMultiIndex" :range-key="'areaName'"
|
||||
:range="servArea[index].regionList">
|
||||
<input disabled class="line-input radius-input" v-if="servArea[index].region"
|
||||
:value="servArea[index].region && servArea[index].region.length ? servArea[index].region[0].areaName + '-' + servArea[index].region[1].areaName : ''"
|
||||
placeholder="请选择区域"></input>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="padding-lr bg-white">
|
||||
<checkbox-group @change="multiAreaCheckDistirct($event, index)" class="grid col-3">
|
||||
<view v-for="(item, index1) in servArea[index].districtList" class="margin-tb-xs">
|
||||
<checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="index1"
|
||||
:checked="item.checked"></checkbox>
|
||||
<text>{{item.areaName}}</text>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar">
|
||||
<view class="action text-black">区域描述<text class="text-red">*</text></view>
|
||||
</view>
|
||||
<view class="padding-lr-sm padding-bottom-sm">
|
||||
<textarea name="areaDesc" style="width: 100%; height: 150rpx;"
|
||||
class="solid radius text-left padding-sm" v-model="servArea[index].areaDesc" maxlength="-1"
|
||||
placeholder="如:XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-center padding-bottom bg-white">
|
||||
<button class="cu-btn bg-main-color light" @click="addServArea">
|
||||
<text class="margin-right-xs"><text class="cuIcon-add"></text></text>
|
||||
<text>继续添加上架城市</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- <view class="cu-form-group">
|
||||
<view class="title">上门费</view>
|
||||
|
|
@ -214,7 +215,7 @@
|
|||
</view> -->
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action text-black">
|
||||
商品封面图上传<text class="text-red">*</text>
|
||||
商品封面图上传<text class="text-red">*</text>【只能一张一张上传】
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
|
|
@ -235,7 +236,7 @@
|
|||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action text-black">
|
||||
详情图上传<text class="text-red">*</text>
|
||||
详情图上传<text class="text-red">*</text>【可多张勾选同时上传】
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
|
|
@ -256,7 +257,7 @@
|
|||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action text-black">
|
||||
轮播图上传<text class="text-red">*</text>
|
||||
轮播图上传<text class="text-red">*</text>【只能一张一张上传】
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
|
|
@ -277,7 +278,7 @@
|
|||
:maxHeight="cropHeight" :url="url2Crop" @cancel="oncancel" @ok="onok"></ksp-cropper>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action text-black">
|
||||
视频上传
|
||||
视频上传【一分钟内的视频最佳】
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bg-white padding-lr padding-bottom-sm">
|
||||
|
|
@ -323,7 +324,7 @@
|
|||
myUniCombox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
return {
|
||||
goodsId: null,
|
||||
formData: {
|
||||
servName: '',
|
||||
|
|
@ -341,7 +342,7 @@
|
|||
descImgList: [],
|
||||
coverImgList: [],
|
||||
videoList: []
|
||||
},
|
||||
},
|
||||
servArea: [],
|
||||
sysInfo: null,
|
||||
url2Crop: '',
|
||||
|
|
@ -418,15 +419,15 @@
|
|||
}, {
|
||||
code: 6,
|
||||
name: '12个月'
|
||||
}],
|
||||
expectDurationList: [{
|
||||
name: '12点前下单,预计当天下午上门/服务'
|
||||
}, {
|
||||
name: '17点前下单,预计次日上门/服务'
|
||||
}, {
|
||||
name: '现时下单,预计次日上门/服务'
|
||||
}, {
|
||||
name: '现时下单,预计后日上门/服务'
|
||||
}],
|
||||
expectDurationList: [{
|
||||
name: '12点前下单,预计当天下午上门/服务'
|
||||
}, {
|
||||
name: '17点前下单,预计次日上门/服务'
|
||||
}, {
|
||||
name: '现时下单,预计次日上门/服务'
|
||||
}, {
|
||||
name: '现时下单,预计后日上门/服务'
|
||||
}],
|
||||
curUserInfo: {},
|
||||
bankCard: null,
|
||||
|
|
@ -442,9 +443,9 @@
|
|||
methods: {
|
||||
async loadData(goodId) {
|
||||
this.sysInfo = uni.getSystemInfoSync();
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
if (goodId) {
|
||||
this.getCurGoodsInfo(goodId);
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
if (goodId) {
|
||||
this.getCurGoodsInfo(goodId);
|
||||
}
|
||||
this.checkBankAndCertify();
|
||||
this.loadCategoryList();
|
||||
|
|
@ -452,80 +453,80 @@
|
|||
// TODO 如果存在goodId说明是修改,需要查询good信息进行回显
|
||||
// this.categoryList = await this.$api.data('categoryList');
|
||||
// this.regionList = await this.$api.data('regionList');
|
||||
},
|
||||
async getCurGoodsInfo(goodsId) {
|
||||
let res1 = await this.$request.qryProductDetail({
|
||||
goodsId: goodsId
|
||||
});
|
||||
let goods = res1.data;
|
||||
|
||||
// 选中规则转map
|
||||
let chosenGoodsStandardMap = new Map();
|
||||
goods.goodsStandardList.forEach(o => {
|
||||
chosenGoodsStandardMap.set(o.deptGoodsCategoryId, o);
|
||||
});
|
||||
// 查询选中的第三级类目下的所有规格
|
||||
let res2 = await this.$request.listByStep({
|
||||
type: 1,
|
||||
goodsCategoryId: goods.deptGoodsCategoryId
|
||||
});
|
||||
let specsList = res2.data;
|
||||
let newSpecsList = [];
|
||||
specsList.forEach(o => {
|
||||
if (chosenGoodsStandardMap.has(o.deptGoodsCategoryId)) {
|
||||
o = chosenGoodsStandardMap.get(o.deptGoodsCategoryId);
|
||||
o.checked = true;
|
||||
}
|
||||
newSpecsList.push(o);
|
||||
});
|
||||
|
||||
// 选中地区转map
|
||||
let chosenAreaMap = new Map();
|
||||
goods.goodsAreaList.forEach(o => {
|
||||
chosenAreaMap.set(o.countryAreaId, o);
|
||||
});
|
||||
// 查询选中的第二级区域下的第三级区域
|
||||
let res3 = await this.$request.areaListByStep({
|
||||
parentCode: goods.parentAreaId
|
||||
});
|
||||
let areaList = res3.data;
|
||||
let newAreaList = [];
|
||||
areaList.forEach(o => {
|
||||
if (chosenAreaMap.has(o.areaId)) {
|
||||
o = chosenAreaMap.get(o.areaId);
|
||||
o.checked = true;
|
||||
}
|
||||
newAreaList.push(o);
|
||||
});
|
||||
|
||||
this.formData = {
|
||||
servName: goods.goodsName,
|
||||
servDesc: goods.goodsDesc,
|
||||
categoryConcatName: goods.categoryConcatName,
|
||||
deptGoodsCategoryId: goods.deptGoodsCategoryId,
|
||||
specsList: newSpecsList,
|
||||
goodsUnit: {
|
||||
name: goods.goodsUnit
|
||||
},
|
||||
warrantyPeriod: {
|
||||
name: goods.warrantyPeriod
|
||||
},
|
||||
servActivity: {
|
||||
name: goods.servActivity
|
||||
},
|
||||
expectDuration: {
|
||||
name: goods.expectDuration
|
||||
},
|
||||
areaConcatName: goods.areaConcatName,
|
||||
districtList: newAreaList,
|
||||
detailDesc: goods.remark,
|
||||
areaDesc: goods.areaDesc,
|
||||
coverImgList: [goods.goodsImgUrl],
|
||||
imgList: goods.lbUrl,
|
||||
descImgList: goods.detailUrl,
|
||||
videoList: goods.goodsVideoUrl ? [goods.goodsVideoUrl] : [],
|
||||
// status: 0,
|
||||
}
|
||||
},
|
||||
async getCurGoodsInfo(goodsId) {
|
||||
let res1 = await this.$request.qryProductDetail({
|
||||
goodsId: goodsId
|
||||
});
|
||||
let goods = res1.data;
|
||||
|
||||
// 选中规则转map
|
||||
let chosenGoodsStandardMap = new Map();
|
||||
goods.goodsStandardList.forEach(o => {
|
||||
chosenGoodsStandardMap.set(o.deptGoodsCategoryId, o);
|
||||
});
|
||||
// 查询选中的第三级类目下的所有规格
|
||||
let res2 = await this.$request.listByStep({
|
||||
type: 1,
|
||||
goodsCategoryId: goods.deptGoodsCategoryId
|
||||
});
|
||||
let specsList = res2.data;
|
||||
let newSpecsList = [];
|
||||
specsList.forEach(o => {
|
||||
if (chosenGoodsStandardMap.has(o.deptGoodsCategoryId)) {
|
||||
o = chosenGoodsStandardMap.get(o.deptGoodsCategoryId);
|
||||
o.checked = true;
|
||||
}
|
||||
newSpecsList.push(o);
|
||||
});
|
||||
|
||||
// 选中地区转map
|
||||
let chosenAreaMap = new Map();
|
||||
goods.goodsAreaList.forEach(o => {
|
||||
chosenAreaMap.set(o.countryAreaId, o);
|
||||
});
|
||||
// 查询选中的第二级区域下的第三级区域
|
||||
let res3 = await this.$request.areaListByStep({
|
||||
parentCode: goods.parentAreaId
|
||||
});
|
||||
let areaList = res3.data;
|
||||
let newAreaList = [];
|
||||
areaList.forEach(o => {
|
||||
if (chosenAreaMap.has(o.areaId)) {
|
||||
o = chosenAreaMap.get(o.areaId);
|
||||
o.checked = true;
|
||||
}
|
||||
newAreaList.push(o);
|
||||
});
|
||||
|
||||
this.formData = {
|
||||
servName: goods.goodsName,
|
||||
servDesc: goods.goodsDesc,
|
||||
categoryConcatName: goods.categoryConcatName,
|
||||
deptGoodsCategoryId: goods.deptGoodsCategoryId,
|
||||
specsList: newSpecsList,
|
||||
goodsUnit: {
|
||||
name: goods.goodsUnit
|
||||
},
|
||||
warrantyPeriod: {
|
||||
name: goods.warrantyPeriod
|
||||
},
|
||||
servActivity: {
|
||||
name: goods.servActivity
|
||||
},
|
||||
expectDuration: {
|
||||
name: goods.expectDuration
|
||||
},
|
||||
areaConcatName: goods.areaConcatName,
|
||||
districtList: newAreaList,
|
||||
detailDesc: goods.remark,
|
||||
areaDesc: goods.areaDesc,
|
||||
coverImgList: [goods.goodsImgUrl],
|
||||
imgList: goods.lbUrl,
|
||||
descImgList: goods.detailUrl,
|
||||
videoList: goods.goodsVideoUrl ? [goods.goodsVideoUrl] : [],
|
||||
// status: 0,
|
||||
}
|
||||
},
|
||||
async checkBankAndCertify() {
|
||||
// 查询账户绑定信息
|
||||
|
|
@ -592,8 +593,9 @@
|
|||
for (let i = 0; i < this.categoryList.length; i++) {
|
||||
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
||||
}
|
||||
this.formData.category = chosenCategory;
|
||||
this.formData.deptGoodsCategoryId = this.formData.category[this.formData.category.length - 1].goodsCategoryId;
|
||||
this.formData.category = chosenCategory;
|
||||
this.formData.deptGoodsCategoryId = this.formData.category[this.formData.category.length - 1]
|
||||
.goodsCategoryId;
|
||||
|
||||
// 查询最后一级品类
|
||||
let res = await this.$request.listByStep({
|
||||
|
|
@ -649,20 +651,22 @@
|
|||
parentCode: chosenRegion[1].areaCode
|
||||
});
|
||||
this.formData.districtList = areaList.data;
|
||||
},
|
||||
async multiRegionChange(e, regionIndex) {
|
||||
this.servArea[regionIndex].regionMultiIndex = e.detail.value;
|
||||
let chosenRegion = [];
|
||||
for (let i = 0; i < this.servArea[regionIndex].regionList.length; i++) {
|
||||
chosenRegion.push(this.servArea[regionIndex].regionList[i][this.servArea[regionIndex].regionMultiIndex[i]]);
|
||||
}
|
||||
this.servArea[regionIndex].region = chosenRegion;
|
||||
|
||||
// 查询最后一级区域
|
||||
let areaList = await this.$request.areaListByStep({
|
||||
parentCode: chosenRegion[1].areaCode
|
||||
});
|
||||
this.servArea[regionIndex].districtList = areaList.data;
|
||||
},
|
||||
async multiRegionChange(e, regionIndex) {
|
||||
this.servArea[regionIndex].regionMultiIndex = e.detail.value;
|
||||
let chosenRegion = [];
|
||||
for (let i = 0; i < this.servArea[regionIndex].regionList.length; i++) {
|
||||
chosenRegion.push(this.servArea[regionIndex].regionList[i][this.servArea[regionIndex]
|
||||
.regionMultiIndex[i]
|
||||
]);
|
||||
}
|
||||
this.servArea[regionIndex].region = chosenRegion;
|
||||
|
||||
// 查询最后一级区域
|
||||
let areaList = await this.$request.areaListByStep({
|
||||
parentCode: chosenRegion[1].areaCode
|
||||
});
|
||||
this.servArea[regionIndex].districtList = areaList.data;
|
||||
},
|
||||
async regionColChange(e) {
|
||||
let colObj = e.detail;
|
||||
|
|
@ -671,24 +675,24 @@
|
|||
let subAreaList = await this.$request.areaListByStep({
|
||||
parentCode: this.regionList[0][colObj.value].areaCode
|
||||
});
|
||||
subAreaList = subAreaList.data;
|
||||
this.regionList.pop();
|
||||
this.regionList.push(subAreaList);
|
||||
subAreaList = subAreaList.data;
|
||||
this.regionList.pop();
|
||||
this.regionList.push(subAreaList);
|
||||
this.regionMultiIndex = [colObj.value, 0];
|
||||
}
|
||||
},
|
||||
async multiRegionColChange(e, regionIndex) {
|
||||
let colObj = e.detail;
|
||||
if (colObj.column == 0) {
|
||||
// 通过一级查二级
|
||||
let subAreaList = await this.$request.areaListByStep({
|
||||
parentCode: this.regionList[0][colObj.value].areaCode
|
||||
});
|
||||
subAreaList = subAreaList.data;
|
||||
this.servArea[regionIndex].regionList.pop();
|
||||
this.servArea[regionIndex].regionList.push(subAreaList);
|
||||
this.servArea[regionIndex].regionMultiIndex = [colObj.value, 0];
|
||||
}
|
||||
},
|
||||
async multiRegionColChange(e, regionIndex) {
|
||||
let colObj = e.detail;
|
||||
if (colObj.column == 0) {
|
||||
// 通过一级查二级
|
||||
let subAreaList = await this.$request.areaListByStep({
|
||||
parentCode: this.regionList[0][colObj.value].areaCode
|
||||
});
|
||||
subAreaList = subAreaList.data;
|
||||
this.servArea[regionIndex].regionList.pop();
|
||||
this.servArea[regionIndex].regionList.push(subAreaList);
|
||||
this.servArea[regionIndex].regionMultiIndex = [colObj.value, 0];
|
||||
}
|
||||
},
|
||||
checkSpecs(e) {
|
||||
let checkedIndexArr = e.detail.value;
|
||||
|
|
@ -705,13 +709,13 @@
|
|||
},
|
||||
showAllSpecs() {
|
||||
this.isShowAllSpecs = !this.isShowAllSpecs;
|
||||
},
|
||||
hideTips(tipName, index) {
|
||||
if (typeof index === 'number' && index >= 0) {
|
||||
this.$refs[tipName][index].close();
|
||||
} else {
|
||||
this.$refs[tipName].close();
|
||||
}
|
||||
},
|
||||
hideTips(tipName, index) {
|
||||
if (typeof index === 'number' && index >= 0) {
|
||||
this.$refs[tipName][index].close();
|
||||
} else {
|
||||
this.$refs[tipName].close();
|
||||
}
|
||||
},
|
||||
checkDistirct(e) {
|
||||
let checkedIndexArr = e.detail.value;
|
||||
|
|
@ -722,16 +726,16 @@
|
|||
this.formData.districtList[i].checked = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
multiAreaCheckDistirct(e, index) {
|
||||
let checkedIndexArr = e.detail.value;
|
||||
for (let i = 0; i < this.servArea[index].districtList.length; i++) {
|
||||
if (checkedIndexArr.indexOf(String(i)) !== -1) {
|
||||
this.servArea[index].districtList[i].checked = true;
|
||||
} else {
|
||||
this.servArea[index].districtList[i].checked = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
multiAreaCheckDistirct(e, index) {
|
||||
let checkedIndexArr = e.detail.value;
|
||||
for (let i = 0; i < this.servArea[index].districtList.length; i++) {
|
||||
if (checkedIndexArr.indexOf(String(i)) !== -1) {
|
||||
this.servArea[index].districtList[i].checked = true;
|
||||
} else {
|
||||
this.servArea[index].districtList[i].checked = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
chooseImgList(e, imgListField, cropWidth, cropHeight) {
|
||||
this.cropWidth = cropWidth && cropWidth > 0 ? cropWidth : this.sysInfo.windowWidth * 2;
|
||||
|
|
@ -833,7 +837,7 @@
|
|||
if (!data.servName) {
|
||||
errMsg = '服务名称不能为空';
|
||||
} else if (!data.servDesc) {
|
||||
errMsg = '服务描述不能为空';
|
||||
errMsg = '搜索关键词不能为空';
|
||||
} else if ((!data.category || !data.category.length) && (!data.categoryConcatName)) {
|
||||
errMsg = '请选择类目';
|
||||
} else if (!data.goodsStandardList || !data.goodsStandardList.length) {
|
||||
|
|
@ -842,8 +846,14 @@
|
|||
return false;
|
||||
} else if (!data.goodsUnit) {
|
||||
errMsg = '商品单位不能为空';
|
||||
} else if (!data.warrantyPeriod) {
|
||||
errMsg = '质保期不能为空';
|
||||
} else if (!data.servActivity) {
|
||||
errMsg = '服务活动不能为空';
|
||||
} else if (!data.expectDuration) {
|
||||
errMsg = '服务时效不能为空';
|
||||
} else if (!data.goodsAreaList || !data.goodsAreaList.length) {
|
||||
errMsg = '至少选择一个上架区域';
|
||||
errMsg = '上架区域填写不完整';
|
||||
} else if (!data.areaDesc) {
|
||||
errMsg = '区域描述不能为空';
|
||||
} else if (!data.coverImgList || !data.coverImgList.length) {
|
||||
|
|
@ -885,57 +895,56 @@
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
validMultiAreaList(list) {
|
||||
let errMsg = null;
|
||||
if (!list || !list.length) {
|
||||
errMsg = '上架区域填写不完整';
|
||||
}
|
||||
if (errMsg) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: errMsg,
|
||||
duration: 2500
|
||||
})
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
async submit() {
|
||||
// 多城市上架区域校验
|
||||
let multiServAreaChecked = true;
|
||||
let multiServAreaList = [];
|
||||
for(let x of this.servArea) {
|
||||
let oneCheckedAreaList = null;
|
||||
if (x && x.districtList && x.districtList.length) {
|
||||
oneCheckedAreaList = x.districtList.filter((item) => {
|
||||
if (item.checked) {
|
||||
item.countryAreaId = item.areaId;
|
||||
return item;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!this.validMultiAreaList(oneCheckedAreaList)) {
|
||||
multiServAreaChecked = false;
|
||||
break;
|
||||
}
|
||||
multiServAreaList.push({
|
||||
goodsAreaList: oneCheckedAreaList,
|
||||
areaDesc: x.areaDesc
|
||||
});
|
||||
}
|
||||
if (!multiServAreaChecked) {
|
||||
return;
|
||||
}
|
||||
|
||||
validMultiAreaList(data) {
|
||||
let errMsg = null;
|
||||
if (!data.goodsAreaList || !data.goodsAreaList.length || !data.areaDesc) {
|
||||
errMsg = '上架区域填写不完整';
|
||||
}
|
||||
if (errMsg) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: errMsg,
|
||||
duration: 2500
|
||||
})
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
async submit() {
|
||||
// 多城市上架区域校验
|
||||
let multiServAreaChecked = true;
|
||||
let multiServAreaList = [];
|
||||
for (let x of this.servArea) {
|
||||
let oneCheckedAreaList = null;
|
||||
if (x && x.districtList && x.districtList.length) {
|
||||
oneCheckedAreaList = x.districtList.filter((item) => {
|
||||
if (item.checked) {
|
||||
item.countryAreaId = item.areaId;
|
||||
return item;
|
||||
}
|
||||
});
|
||||
}
|
||||
let oneServAreaObj = {
|
||||
goodsAreaList: oneCheckedAreaList,
|
||||
areaDesc: x.areaDesc
|
||||
}
|
||||
if (!this.validMultiAreaList(oneServAreaObj)) {
|
||||
multiServAreaChecked = false;
|
||||
break;
|
||||
}
|
||||
multiServAreaList.push(oneServAreaObj);
|
||||
}
|
||||
if (!multiServAreaChecked) {
|
||||
return;
|
||||
}
|
||||
|
||||
let goodsStandardList = this.formData.specsList.filter((item) => {
|
||||
if (item.checked) {
|
||||
if (!item.goodsStandardName) {
|
||||
item.goodsStandardName = item.goodsCategoryName;
|
||||
}
|
||||
return {
|
||||
...item
|
||||
}
|
||||
return item;
|
||||
}
|
||||
});
|
||||
let goodsAreaList = this.formData.districtList.filter((item) => {
|
||||
|
|
@ -977,9 +986,9 @@
|
|||
let params = {
|
||||
goodsName: this.formData.servName,
|
||||
goodsDesc: this.formData.servDesc,
|
||||
goodsUnit: this.formData.goodsUnit.name,
|
||||
warrantyPeriod: this.formData.warrantyPeriod.name,
|
||||
servActivity: this.formData.servActivity.name,
|
||||
goodsUnit: this.formData.goodsUnit.name,
|
||||
warrantyPeriod: this.formData.warrantyPeriod.name,
|
||||
servActivity: this.formData.servActivity.name,
|
||||
expectDuration: this.formData.expectDuration.name,
|
||||
deptGoodsCategoryId: this.formData.deptGoodsCategoryId,
|
||||
goodsStandardList: goodsStandardList,
|
||||
|
|
@ -988,28 +997,28 @@
|
|||
goodsImgsList: goodsImgsList,
|
||||
goodsVideoUrl: goodsVideoUrl,
|
||||
status: 0,
|
||||
remark: this.formData.detailDesc,
|
||||
remark: this.formData.detailDesc,
|
||||
areaDesc: this.formData.areaDesc
|
||||
}
|
||||
|
||||
let res = null;
|
||||
if (this.goodsId) {
|
||||
res = await this.$request.editGoods({
|
||||
...params,
|
||||
goodsId: this.goodsId
|
||||
});
|
||||
} else {
|
||||
res = await this.$request.addGoods(params);
|
||||
}
|
||||
// 如果选了多城市,添加多个服务
|
||||
let index = 0;
|
||||
while(index < multiServAreaList.length && res && res.code === 0) {
|
||||
res = await this.$request.addGoods({
|
||||
...params,
|
||||
goodsAreaList: multiServAreaList[index].goodsAreaList,
|
||||
areaDesc: multiServAreaList[index].areaDesc
|
||||
});
|
||||
index++;
|
||||
}
|
||||
|
||||
let res = null;
|
||||
if (this.goodsId) {
|
||||
res = await this.$request.editGoods({
|
||||
...params,
|
||||
goodsId: this.goodsId
|
||||
});
|
||||
} else {
|
||||
res = await this.$request.addGoods(params);
|
||||
}
|
||||
// 如果选了多城市,添加多个服务
|
||||
let index = 0;
|
||||
while (index < multiServAreaList.length && res && res.code === 0) {
|
||||
res = await this.$request.addGoods({
|
||||
...params,
|
||||
goodsAreaList: multiServAreaList[index].goodsAreaList,
|
||||
areaDesc: multiServAreaList[index].areaDesc
|
||||
});
|
||||
index++;
|
||||
}
|
||||
if (res && res.code === 0) {
|
||||
uni.showToast({
|
||||
|
|
@ -1019,23 +1028,23 @@
|
|||
url: '/pages/index/index?menuCode=supplyChainPage'
|
||||
})
|
||||
}
|
||||
},
|
||||
async addServArea() {
|
||||
let subRegionList = await this.$request.areaListByStep({
|
||||
parentCode: this.regionList[0][0].areaCode
|
||||
});
|
||||
subRegionList = subRegionList.data;
|
||||
|
||||
this.servArea.push({
|
||||
region: [],
|
||||
districtList: [],
|
||||
areaDesc: null,
|
||||
regionList: [this.regionList[0], subRegionList],
|
||||
regionMultiIndex: [0, 0]
|
||||
});
|
||||
},
|
||||
delServArea(index) {
|
||||
this.servArea.splice(index, 1);
|
||||
},
|
||||
async addServArea() {
|
||||
let subRegionList = await this.$request.areaListByStep({
|
||||
parentCode: this.regionList[0][0].areaCode
|
||||
});
|
||||
subRegionList = subRegionList.data;
|
||||
|
||||
this.servArea.push({
|
||||
region: [],
|
||||
districtList: [],
|
||||
areaDesc: null,
|
||||
regionList: [this.regionList[0], subRegionList],
|
||||
regionMultiIndex: [0, 0]
|
||||
});
|
||||
},
|
||||
delServArea(index) {
|
||||
this.servArea.splice(index, 1);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
@ -1046,6 +1055,16 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
.cu-form-group .title {
|
||||
flex-basis: 26%;
|
||||
text-align: justify;
|
||||
padding-right: 10rpx;
|
||||
font-size: 30rpx;
|
||||
position: relative;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.certern-height {
|
||||
max-height: 520rpx;
|
||||
overflow: hidden;
|
||||
|
|
@ -1061,9 +1080,9 @@
|
|||
|
||||
.radius-input.xs {
|
||||
font-size: 23rpx;
|
||||
}
|
||||
|
||||
.radius-input.sm {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
.radius-input.sm {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue