Commit d2308455 authored by dragondean@qq.com's avatar dragondean@qq.com

海运和空运批量价格设置,价格列表

parent 47b6fa0b
......@@ -46,6 +46,9 @@ export default {
align-items: center;
justify-content: center;
}
.items-center{
align-items: center;
}
.empty-placeholder{
padding: 50px;
text-align: center;
......
......@@ -106,4 +106,13 @@ export function getProductPriceGetPrice(query) {
method: 'get',
params: query
})
}
\ No newline at end of file
}
// 更新单询
export function updateOrderInquiry(data) {
return request({
url: '/ecw/product-price/updateOrderInquiry',
method: 'put',
data: data
})
}
......@@ -188,6 +188,8 @@ export const DICT_TYPE = {
WAREHOUSING_SPECIFICATION_TYPE: 'warehousing_specification_type',
ECW_AUTH_TYPE:'auth_type',//品牌授权
NEED_ORDER_INQUIRY: 'need_order_inquiry', // 是否需要単询
ECASH_INIT:'ecash_init', //e-cash
FEE_TYPE:'receivable_fee_type',
// PAY_TYPE:'payment_type',
......
......@@ -13,118 +13,142 @@
<el-checkbox label="" @change="form.stepPrice=$event ? 1 : 0">{{$t('阶梯价格')}}</el-checkbox>
</span>
</div>
<el-form-item :label="$t('预付')" prop="needPay" >
<el-radio-group v-model="form.needPay">
<el-radio :label="1">{{ $t('预付') }}</el-radio>
<el-radio :label="0">{{ $t('均可') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('单价模式')" prop="priceType">
<dict-selector :type="DICT_TYPE.ECW_PRICE_TYPE" v-model="form.priceType" form-type="radio" />
</el-form-item>
<!--阶梯订单-->
<template v-if="form.stepPrice==1" >
<div v-for="(item, index) in form.priceStepList" :key="index">
<div style="font-size:14px; margin:10px 0">
{{$t('第{index}阶梯定价方案', {index: index+1})}}
<template v-if="index == form.priceStepList.length - 1">
<el-link type="primary" @click.native="form.priceStepList.push({})">{{$t('添加区间')}}</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click.native="form.priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
</template>
</div>
<el-form-item :label="$t(`第{index}阶梯`, {index: index+1})">
<el-input v-model="item.startNum" type="number" placeholder="" class="w100"></el-input>
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w100"></el-input>
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="form.weightUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('预付')" prop="needPay" >
<el-radio-group v-model="form.needPay">
<el-radio :label="1">{{ $t('预付') }}</el-radio>
<el-radio :label="0">{{ $t('均可') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1 && type != 'air'">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
<el-form-item :label="$t('单价模式')" prop="priceType">
<dict-selector :type="DICT_TYPE.ECW_PRICE_TYPE" v-model="form.priceType" form-type="radio" />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
</div>
</template>
<!--阶梯订单-->
<template v-if="form.stepPrice==1" >
<div v-for="(item, index) in form.priceStepList" :key="index">
<div style="font-size:14px; margin:10px 0">
{{$t('第{index}阶梯定价方案', {index: index+1})}}
<template v-if="index == form.priceStepList.length - 1">
<el-link type="primary" @click.native="form.priceStepList.push({})">{{$t('添加区间')}}</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click.native="form.priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
</template>
</div>
<el-form-item :label="$t(`第{index}阶梯`, {index: index+1})">
<el-input v-model="item.startNum" type="number" placeholder="" class="w100"></el-input>
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w100"></el-input>
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="form.weightUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1 && type != 'air'">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<template v-else>
<el-form-item
:label="$t('最小起计量')"
:prop="`minWeight`"
>
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
</div>
</template>
<!--非阶梯订单-->
<template v-else>
<el-form-item
:label="$t('最小起计量')"
:prop="`minWeight`"
>
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector v-model="form.allPriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector v-model="form.allVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<template v-else>
<el-form-item :label="$t('默认运费')" prop="transportPrice">
<selector v-model="form.transportPriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector v-model="form.transportVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" prop="clearancePrice" v-if="type != 'air'">
<selector v-model="form.clearancePriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector v-model="form.clearanceVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
</template>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector v-model="form.allPriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector v-model="form.allVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<template v-else>
<el-form-item :label="$t('默认运费')" prop="transportPrice">
<selector v-model="form.transportPriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector v-model="form.transportVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" prop="clearancePrice" v-if="type != 'air'">
<selector v-model="form.clearancePriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector v-model="form.clearanceVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
</template>
<!--特需-->
<template v-if="form.priceType==1">
<el-form-item
v-for="(special, specialIndex) in form.specialList"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
:key="specialIndex + 'transport'">
<!--特需-->
<template v-if="form.priceType==1">
<el-form-item
v-for="(special, specialIndex) in form.specialList"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
:key="specialIndex + 'transport'">
<selector disabled v-model="special.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
<template v-else v-for="(special, specialIndex) in form.specialList">
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:key="specialIndex + 'transport'">
<selector disabled v-model="special.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item
v-if="type != 'air'"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
:key="specialIndex + 'clearance'">
<selector disabled v-model="special.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
</el-form-item>
</template>
<template v-else v-for="(special, specialIndex) in form.specialList">
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:key="specialIndex + 'transport'">
<selector disabled v-model="special.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item
v-if="type != 'air'"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
:key="specialIndex + 'clearance'">
<selector disabled v-model="special.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
<!-- <el-form-item :label="$t('是否预付')" prop="advanceStatus">
<dict-selector form-type="radio" :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
</el-form-item> -->
<el-form-item :label="$t('价格有效期')">
<el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
-
<el-date-picker v-model="form.validateEndDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<!-- <el-form-item :label="$t('是否预付')" prop="advanceStatus">
<dict-selector form-type="radio" :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
</el-form-item> -->
<el-form-item :label="$t('价格有效期')">
<el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
-
<el-date-picker v-model="form.validateEndDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" v-if="form.stepPrice">
<h2>{{$t('快捷设置')}}</h2>
<div class="flex items-center">
{{$t('批量加价')}}+
<el-input v-model="quickForm.plus" class="w-100 ml-10 mr-10" :disabled="!!quickForm.minus"></el-input>
<selector disabled v-model="currencyAndUnit.currency" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100" />
/ <selector disabled v-model="currencyAndUnit.unit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
<div class="ml-10">{{$t('*针对所有价格加价')}}</div>
</div>
<div class="flex items-center mt-10">
{{$t('批量减价')}} -
<el-input v-model="quickForm.minus" class="w-100 ml-10 mr-10" :disabled="!!quickForm.plus"></el-input>
<selector disabled v-model="currencyAndUnit.currency" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100" />
/ <selector disabled v-model="currencyAndUnit.unit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
<div class="ml-10">{{$t('*针对所有价格加价')}}</div>
</div>
<div class="mt-10">
<el-button @click="quickSet" type="primary" :disabled="!quickForm.plus && !quickForm.minus">{{$t('确定')}}</el-button>
</div>
</el-col>
</el-row>
</el-card>
......@@ -154,8 +178,7 @@
</template>
<el-form-item :label="$t('是否単询')" prop="inquiry">
<!--// TODO 字段待完善-->
<el-input v-model.number="form.needOrderInquiry" type="number" style="width:200px" />
<dict-selector :type="DICT_TYPE.NEED_ORDER_INQUIRY" v-model="form.needOrderInquiry" form-type="radio"></dict-selector>
</el-form-item>
</el-card>
</el-form>
......@@ -168,19 +191,16 @@
</template>
<script>
import RoutersSelector from '@/components/RoutersSelector'
import { createProductPrice, updateProductPrice, batchUpdateProductPrice, deleteProductPrice, getProductPrice, getProductPriceList, getProductPricePage, exportProductPriceExcel } from "@/api/ecw/productPrice";
import { getProductType, getProductTypeList } from '@/api/ecw/productType'
import { batchUpdateProductPrice} from "@/api/ecw/productPrice";
import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit';
import ProductsSelector from '@/components/ProductsSelector'
import { arrryToKeyedObjectBy } from '@/utils/index'
import Selector from '@/components/Selector'
import Inputor from '@/components/Inputor'
import { parseTime } from '@/utils/ruoyi'
import Template from "@/views/cms/template";
import Decimal from 'decimal.js'
export default {
components: {Template, RoutersSelector, ProductsSelector, Selector, Inputor },
components: { RoutersSelector, ProductsSelector, Selector, Inputor },
data() {
return {
checkList: [],
......@@ -206,12 +226,30 @@ export default {
productDisabled: true,
lineList: [], //路线数组
loading: false,
// 批量加价/减价
quickForm:{}
}
},
computed: {
// 类型,默认海运sea,air表示空运
type(){
return this.$route.path.split(/[-_]/).pop()
},
// 默认运费的货币和体积单位
currencyAndUnit(){
let currency = null, unit = null, fields = null
// 如果是阶梯价格则取第一阶梯,否则就取form中的字段
let obj = this.form.stepPrice == 1 ? this.form.priceStepList[0] : this.form
// 全包价
if(this.form.priceType == 1){
currency = obj.allPriceUnit
unit = obj.allVolumeUnit
}else{
currency = obj.transportPriceUnit
unit = obj.transportVolumeUnit
}
return {currency, unit}
}
},
watch: {
......@@ -226,43 +264,7 @@ export default {
},
product() {
this.$set(this.form, 'productType', this.product.typeId)
/* getProductType(this.product.typeId).then(res => {
this.productType = res.data
}) */
},
/*
批量操作没有回显需求
form(val) {
if (!val) return
// 特殊需求回显
if (val.specialList) {
let keyed = arrryToKeyedObjectBy(val.specialList, 'specialDictType')
this.specialList.map((item, index) => {
if (keyed[item.specialDictType]) {
for (let field in item) {
if (keyed[item.specialDictType][field]) {
item[field] = keyed[item.specialDictType][field]
}
}
}
})
}
}, */
/* '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
})
}, */
'form.stepPrice'(stepPrice){
if(stepPrice == 1 && !this.form.priceStepList.length){
this.form.priceStepList = [{}, {}]
......@@ -413,6 +415,17 @@ export default {
.finally(res => this.loading = false)
});
},
// 快捷设置,只更新默认运费
quickSet(){
// 字段,根据是否全包价来取
let field = this.form.priceType == 1 ? 'allPrice' : 'transportPrice'
// 取得要加的数额(减少则是负数)
let amount = Decimal(this.quickForm.plus || -this.quickForm.minus)
this.form.priceStepList.forEach(item => {
// 加上对应的价格,但是不能小于0
this.$set(item, field, Math.max(0, Decimal(item[field] || 0).plus(amount).toNumber()))
})
}
}
}
</script>
......
<template>
<div class="app-container">
<div class="page-title">{{$route.query.product_id ? productTitle + '-' : this.$t('全部')}}{{$t('路线价格列表')}}</div>
<div class="page-title">{{$route.query.product_id ? productTitle + '-' + $t('路线价格列表') : routeName}}</div>
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('商品名称')" prop="titleZh" v-if="!$route.query.product_id">
......@@ -15,7 +15,8 @@
<el-form-item :label="$t('运输方式')" prop="transportType">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" clearable />
</el-form-item>
<el-form-item :label="$t('出货渠道')" prop="shippingChannelId">
<!--海运不显示渠道-->
<el-form-item :label="$t('出货渠道')" prop="shippingChannelId" v-if="type == 'sea'">
<el-select v-model="queryParams.shippingChannelId" clearable>
<el-option v-for="item in channelList" :key="item.id" :label="$l(item, 'name')" :value="item.channelId" />
</el-select>
......@@ -61,9 +62,9 @@
<!--<el-button type="primary" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit">{{$t('批量设置价格')}}</el-button>-->
<el-button type="primary" v-hasPermi="['ecw:product-price:bartch_black']" size="mini" @click="batchBlock" :disabled="multiple">{{$t('批量加入黑名单')}}</el-button>
<el-button type="primary" v-hasPermi="['ecw:product-price:batch_down']" size="mini" @click="batchOff" :disabled="multiple">{{$t('批量下架')}}</el-button>
<el-button type="warning" v-hasPermi="['ecw:product-price:export']" @click="handleExport" :loading="exportLoading" >{{$t('导出')}}</el-button>
<el-button type="primary" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('sea')">{{$t('批量设置海运价格')}}</el-button>
<el-button type="primary" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('air')">{{$t('批量设置空运价格')}}</el-button>
<el-button type="warning" v-hasPermi="['ecw:product-price:export']" size="mini" @click="handleExport" :loading="exportLoading" >{{$t('导出')}}</el-button>
<el-button type="primary" v-if="type != 'air'" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('sea')">{{$t('批量设置海运价格')}}</el-button>
<el-button type="primary" v-if="type != 'sea'" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('air')">{{$t('批量设置空运价格')}}</el-button>
</template>
<!--指定商品-->
......@@ -179,7 +180,11 @@
</div>
</template>
</el-table-column>
<el-table-column prop="advanceStatus" :label="$t('単询')" align="center" width="80">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.NEED_ORDER_INQUIRY" :value="scope.row.needOrderInquiry"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="advanceStatus" :label="$t('预付')" align="center" width="80">
<template slot-scope="scope">
<div>
......@@ -208,6 +213,9 @@
v-hasPermi="['ecw:product-price:down']">{{scope.row.auditStatus == AuditStatusEnum.PASS ? $t('下架') : $t('上架')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:product-price:delete']">{{$t('删除')}}</el-button>
<el-button @click="copyTemplate(scope.row)" size="mini" type="text">复制模板</el-button>
<el-button @click="setOrderInquiry(scope.row, 0)" v-if="scope.row.needOrderInquiry" size="mini" type="text">取消単询</el-button>
<el-button @click="setOrderInquiry(scope.row, 1)" v-else size="mini" type="text">加入単询</el-button>
</template>
</el-table-column>
</el-table>
......@@ -219,7 +227,17 @@
</template>
<script>
import { createProductPrice, updateProductPrice, deleteProductPrice, getProductPrice, getProductPricePage, exportProductPriceExcel, batchBlock, batchOff } from "@/api/ecw/productPrice";
import {
createProductPrice,
updateProductPrice,
deleteProductPrice,
getProductPrice,
getProductPricePage,
exportProductPriceExcel,
batchBlock,
batchOff,
updateOrderInquiry
} from "@/api/ecw/productPrice";
import { openedRouterList } from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
import { getProductTypeList } from "@/api/ecw/productType";
......@@ -325,6 +343,22 @@ export default {
},
computed: {
// 路径中的运输方式参数
transportType() {
return this.$route.path.split('-').pop();
},
// 路由中的标题
routeName(){
return this.$route.name
},
// 类型,transportType是1和2(1_2用一个表示)表示海运,3和4表示空运
type(){
// 如果没有则表示商品路线价格
if(!this.transportType){
return null
}
return ['3','4'].indexOf(this.transportType) > -1 ? 'air' : 'sea'
},
// 商品名称
productTitle(){
if(!this.product){
......@@ -468,6 +502,10 @@ export default {
this.product = res.data
})
}else{
// 如果指定了单个的运输方式则赋值
if(this.transportType.split('_').length == 1){
this.$set(this.queryParams, 'transportType', +this.transportType)
}
this.getAttrList();
}
......@@ -754,6 +792,19 @@ export default {
})
},
// 设置,取消単询
setOrderInquiry(row, needOrderInquiry){
row.needOrderInquiry = needOrderInquiry
updateOrderInquiry(row).then(res => {
this.$message.success(res.msg || this.$t('操作成功'))
this.getList()
})
},
// 复制模板
copyTemplate(row){
this.$alert('// TODO')
}
}
};
</script>
......
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