Commit 91131da6 authored by dragondean@qq.com's avatar dragondean@qq.com

修复bug,完善路线价格和商品批量修改

parent ffcacc51
......@@ -83,10 +83,10 @@ export default {
computed:{
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
return this.tradeCityList.filter(item => item.type == 1 || item.type == 3)
},
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
return this.tradeCityList.filter(item => item.type == 2 || item.type == 3)
},
availChannelList(){
return this.channelList.filter(item => !this.channelId || this.channelId == item.channelId)
......@@ -197,7 +197,8 @@ export default {
if(selected){
this.selectedRoutes.push({
lineId: router.id,
channelId: router.channel.channelId
channelId: router.channel.channelId,
transportId: router.transportType
})
}else{
let index = this.getSelectedIndex(router)
......
......@@ -66,7 +66,7 @@
<el-descriptions-item label="*始发城市" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="departureId" required error="始发地必选">
<el-select v-model="form.departureId" placeholder="请选择始发地">
<el-option v-for="item in expoerCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in exportCityList" :label="item.titleZh" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
......@@ -316,7 +316,7 @@
<el-descriptions-item label="入仓类型">
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="form.warehouseType" />
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="form.warehouseType" defaultable />
</el-descriptions-item>
<el-descriptions-item label="收货方式">
<dict-selector :type="DICT_TYPE.ECW_HARVEST_METHOD" v-model="form.harvestMethod" :filter="item => item.value == 1 || homeDeliveryService" defaultable />
......@@ -494,11 +494,25 @@ export default {
};
},
computed:{
expoerCityList(){
return this.tradeCityList.filter(item => item.type == 2)
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2 || item.type == 3)
},
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
return this.tradeCityList.filter(item => item.type == 1 || item.type == 3)
},
exportCityIds(){
let ids = []
this.exportCityList.forEach(item => {
ids.push(item.id)
})
return ids
},
importCityIds(){
let ids = []
this.importCityList.forEach(item => {
ids.push(item.id)
})
return ids
},
getDictData(){
return (type, value) => getDictData(type, value) || {}
......@@ -506,17 +520,6 @@ export default {
getDictDatas(){
return getDictDatas
},
// 根据线路id显示线路名称
/* getRouterNameById(){
return routerId => {
let router = this.routerList.find(item => item.id == routerId)
if(router){
return router.startTitleZh + ' > ' + router.destTitleZh
}
return '-'
}
}, */
selectedRouter(){
// otherService 1 送货上门,2非控货订单代收货款
if(!this.form.lineId)return null
......@@ -740,7 +743,9 @@ export default {
if(this.form.transportId){
params.transportType = this.form.transportId
}
getOpenedRouterList(params).then(res => this.routerList = res.data)
getOpenedRouterList(params).then(res => this.routerList = res.data.filter(item => {
return this.exportCityIds.indexOf(item.startCityId) > -1 && this.importCityIds.indexOf(item.destCityId) > -1
}))
},
// 计算体积
calcVolume(row){
......
......@@ -133,7 +133,7 @@
<template slot-scope="{row}">{{row.totalNum}}箱/{{row.sumNum}}</template>
</el-table-column>
<el-table-column label="体积/重量" align="center" prop="sumWeight">
<template slot-scope="{row}">{{row.totalVolume}}m³ /{{row.totalWeight}}Kg</template>
<template slot-scope="{row}">{{row.sumVolume}}m³ /{{row.sumWeight}}Kg</template>
</el-table-column>
<el-table-column label="始发仓" align="center" prop="departureName" />
<el-table-column label="运输方式/目的地" align="center" prop="transportId">
......
......@@ -11,7 +11,7 @@
<div class="line">路线:{{order.logisticsInfoDto.startTitleZh}} >> {{order.logisticsInfoDto.destTitleZh}}</div>
<div class="line">商品列表:
<span v-for="(item, index) in order.orderItemVOList" :key="index">
{{item.titleZh}}
{{item.prodTitleZh}}
<template v-if="index < order.orderItemVOList.length - 1"></template>
</span>
</div>
......
......@@ -172,13 +172,13 @@
</el-select>
</el-form-item>
<el-form-item label="默认方数要求" prop="square">
<el-form-item label="订单方数上限" prop="square">
<el-input v-model.number="form.square" type="number">
<!-- <template slot="append">立方米</template> -->
</el-input>
</el-form-item>
<el-form-item label="需要预约入仓" prop="needBook">
<el-form-item label="预约入仓" prop="needBook">
<el-radio v-model.number="form.needBook" :label="1"></el-radio>
<el-radio v-model.number="form.needBook" :label="0"></el-radio>
</el-form-item>
......
......@@ -12,22 +12,25 @@
<el-form-item label="出运要求" prop="requirements">
<el-checkbox true-label="1" v-model="form.requirements">证书要求(支持多证书)</el-checkbox>
</el-form-item>
<el-form-item label="方数要求" prop="square">
<el-input v-model="form.square" placeholder="" style="width: 200px"></el-input>
<el-form-item label="订单方数上限" prop="square">
<el-input v-model="form.square" placeholder="" class="w-200"></el-input>
</el-form-item>
<el-form-item label="包装要求" prop="packaging">
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.packaging" />
</el-form-item>
<el-form-item label="需要预约入仓" prop="needBook">
<el-form-item label="是否预约入仓" prop="needBook">
<dict-selector formatter="bool" form-type="radio" :type="DICT_TYPE.ECW_YESNO" v-model="form.needBook" :formater="Boolean" />
</el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit">
<el-input placeholder="" v-model="form.dayLimit" style="width: 200px">
<el-form-item label="每日入仓上限" prop="dayLimit" v-if="form.needBook">
<el-input placeholder="" v-model="form.dayLimit" class="w-200">
<template slot="suffix">立方米</template>
</el-input>
</el-form-item>
<el-form-item label="商品特性" prop="attrId">
<dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.attrId" multiple />
<!-- <dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.attrId" multiple /> -->
<el-checkbox-group v-model="attrIds">
<el-checkbox v-for="item in attrList" :label="item.id" :key="item.id">{{item.attrName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="商品材质" prop="materialType">
<dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.materialType" multiple />
......@@ -43,7 +46,7 @@
</template>
<script>
import { batchUpdateProduct } from '@/api/ecw/product';
import { getProductAttrList } from "@/api/ecw/productAttr";
import CustomersSelector from '@/components/CustomersSelector'
import { getDictData } from '@/utils/dict'
import RoutersSelector from '@/components/RoutersSelector'
......@@ -57,6 +60,8 @@ export default {
return {
// 遮罩层
loading: true,
attrList: [],
attrIds:[],
// 表单参数
form: {
"attrId": undefined,
......@@ -64,7 +69,7 @@ export default {
"dayLimit": undefined,
"idList": [],
"isAllProduct": undefined,
"needBook": undefined,
"needBook": false,
"packaging": undefined,
"requirements": undefined,
"square": undefined,
......@@ -85,11 +90,17 @@ export default {
} else {
this.form.isAllProduct = 1
}
},
attrIds(val){
this.form.attrId = val.join(',')
}
},
created() {
this.reset()
this.form.idList = this.$route.query && this.$route.query.ids ? [...this.$route.query.ids].map(item => { return Number(item) }) : []
getProductAttrList().then(res => {
this.attrList = res.data
})
},
methods: {
/** 表单重置 */
......@@ -100,7 +111,7 @@ export default {
"dayLimit": undefined,
"idList": [],
"isAllProduct": undefined,
"needBook": undefined,
"needBook": false,
"packaging": undefined,
"requirements": undefined,
"square": undefined,
......
This diff is collapsed.
......@@ -294,12 +294,12 @@
基础信息
</div>
<el-form-item label="需要预约入仓" prop="needBook">
<el-form-item label="是否预约入仓" prop="needBook">
<el-radio v-model.number="form.needBook" :label="1"></el-radio>
<el-radio v-model.number="form.needBook" :label="0"></el-radio>
</el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit">
<el-form-item label="每日入仓上限" prop="dayLimit" v-if="form.needBook == 1">
<el-input v-model.number="form.dayLimit" type="number">
<template slot="append">立方米</template>
</el-input>
......@@ -311,7 +311,7 @@
</el-select>
</el-form-item>
<el-form-item label="方数要求" prop="square">
<el-form-item label="订单方数上限" prop="square">
<el-input v-model.number="form.square" type="number">
<!-- <template slot="append">立方米</template> -->
</el-input>
......
......@@ -2,7 +2,7 @@
<div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="商品类型" prop="typeId">
<el-form-item label="商品类型" prop="productType">
<el-select v-model="form.productType" :disabled="!!$route.query.ids">
<el-option v-for="type in productTypeList" :key="type.id" :label="type.titleZh" :value="type.id" />
</el-select>
......@@ -209,12 +209,12 @@
基础信息
</div>
<el-form-item label="需要预约入仓" prop="needBook">
<el-form-item label="是否预约入仓" prop="needBook">
<el-radio v-model.number="form.needBook" :label="1"></el-radio>
<el-radio v-model.number="form.needBook" :label="0"></el-radio>
</el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit">
<el-form-item label="每日入仓上限" prop="dayLimit" v-if="form.needBook == 1">
<el-input v-model.number="form.dayLimit" type="number" class="w-100" />立方米
</el-form-item>
......@@ -222,7 +222,7 @@
<dict-selector :type="DICT_TYPE.ECW_CONTAINER_LOCATION" v-model="form.containerLocation" />
</el-form-item>
<el-form-item label="方数要求" prop="square">
<el-form-item label="订单方数上限" prop="square">
<el-input v-model.number="form.square" type="number" style="width:200px" />
</el-form-item>
</el-card>
......@@ -253,7 +253,9 @@ export default {
selectedRoutes: [], // 勾选的路线渠道
form: {
stepPrice: 0,
advanceStatus: 0
advanceStatus: 0,
needBook: 0,
dayLimit: 10000
},
specialProducts: [],
priceStepList: [{},{}], // 阶梯价格
......@@ -269,7 +271,7 @@ export default {
//square: [{ required: true, message: "方数不能为空", trigger: "blur" }],
// zhongLinjie:[{ required: true, message: "默认重货标准不能为空", trigger: "blur" }],
// paoLinjie:[{ required: true, message: "默认泡货标准不能为空", trigger: "blur" }],
needBook: [{ required: true, message: "预约入仓不能为空", trigger: "blur" }],
// needBook: [{ required: true, message: "预约入仓不能为空", trigger: "blur" }],
},
product: null,
/* productType: null, */
......@@ -293,11 +295,12 @@ export default {
this.form.lineChannelList = []
}
},
/* product() {
getProductType(this.product.typeId).then(res => {
product() {
this.$set(this.form, 'productType', this.product.typeId)
/* getProductType(this.product.typeId).then(res => {
this.productType = res.data
})
}, */
}) */
},
form(val) {
if (!val) return
// 特殊需求回显
......@@ -314,10 +317,35 @@ export default {
})
}
},
'form.transportVolumeUnit'(val){
this.specialProducts.forEach(item => {
item.transportVolumeUnit = val
})
},
'form.clearanceVolumeUnit'(val){
this.specialProducts.forEach(item => {
item.clearanceVolumeUnit = val
})
},
'form.allVolumeUnit'(val){
this.specialProducts.forEach(item => {
item.allVolumeUnit = val
})
},
selectedRoutes(routers) {
let transportIds = []
routers.forEach(item => {
item.shippingChannelId = item.channelId
transportIds.push(+item.transportId)
})
// 如果只选择了空运(3),则默认体积单位改成千克
transportIds = new Set(transportIds)
console.log(transportIds)
window.transportIds = transportIds
if(transportIds.size == 1 && transportIds.has(3)){
this.setDefaultVolumeUnit(6)
}else this.setDefaultVolumeUnit(7)
}
},
async created() {
......@@ -356,6 +384,8 @@ export default {
}) */
}
// 默认费用单位
this.setDefaultVolumeUnit(7)
}
/* // 指定产品
else
......@@ -379,6 +409,11 @@ export default {
})
},
methods: {
setDefaultVolumeUnit(unit){
this.$set(this.form, 'transportVolumeUnit', unit)
this.$set(this.form, 'clearanceVolumeUnit', unit)
this.$set(this.form, 'allVolumeUnit', unit)
},
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
......@@ -400,7 +435,7 @@ export default {
}
// 修改的提交
if (this.$route.query.ids) {
if (this.$route.query.action == 'update') {
if(this.lineList.length == 1){
data.lineChannelList = {
lineId: this.lineList[0].warehouseLineId,
......@@ -409,7 +444,6 @@ export default {
}else{
data.lineChannelList = []
this.lineList.forEach(item => {
console.log(item.id, this.checkList.indexOf(item.id) > -1)
if(this.checkList.indexOf(item.id) > -1){
data.lineChannelList.push({
lineId: item.warehouseLineId,
......
......@@ -66,11 +66,13 @@
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:product-price:create']">新建价格</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-if="!$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="handleBatchEdit" :disabled="multiple">设置已选路线价格</el-button>
<!--未指定商品-->
<el-button v-if="!$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="handleBatchEdit">批量设置价格</el-button>
<el-button v-if="!$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="handleBatchEdit" :disabled="multiple">批量加入黑名单</el-button>
<el-button v-if="!$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="handleBatchEdit" :disabled="multiple">批量下架</el-button>
<el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleBatchEdit" :disabled="multiple">批量设置路线</el-button>
<!--指定商品-->
<el-button v-if="$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="batchSetSingleProductPrice">批量设置单个商品的路线路线</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
......@@ -381,14 +383,23 @@ export default {
activated() {
console.log('activated')
let typeId = this.$route.query.product_type;
if(typeId) {
if(!this.queryParams.typeId || this.queryParams.typeId != typeId)
this.$set(this.queryParams, 'typeId', +typeId);
}
this.$set(this.queryParams, 'typeId', +this.$route.query.product_type || null)
this.handleQuery()
},
watch:{
'$route.query.product_id'(){
console.log(this.$route.query)
if(!this.$route.query.product_id){
return this.product = null
}
if(!this.product || this.$route.query.product_id == this.product.id){
getProduct(this.$route.query.product_id).then(res => {
this.product = res.data
})
}
}
},
created() {
// this.transportDatas = getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE);
// console.log(this.transportDatas);
......@@ -571,9 +582,12 @@ export default {
return this.$router.push('../../lineProject/product-price/edit?' + (new URLSearchParams(this.$route.query)).toString())
},
batchSetSingleProductPrice(){
this.$router.push('../../lineProject/product-price/edit?action=update&product_id=' + this.$route.query.product_id + '&ids=' + this.ids)
},
// 批量设置路线
handleBatchEdit() {
this.$router.push('../../lineProject/product-price/edit?ids=' + this.ids)
this.$router.push('../../lineProject/batch-edit')
},
/** 修改按钮操作 */
handleUpdate(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment