Commit 497e23d3 authored by 我在何方's avatar 我在何方
parents 69426a1d 61d2ddee
......@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站
# 捷道管理系统/开发环境
VUE_APP_BASE_API = 'https://api.jd.jdshangmen.com'
VUE_APP_BASE_API = 'https://apitest.groupage.cn'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -18,4 +18,4 @@ VUE_APP_TENANT_ENABLE = false
VUE_APP_DOC_ENABLE = true
# 百度统计
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
\ No newline at end of file
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
......@@ -40,26 +40,30 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => {
'Content-Length': querystring.stringify(params).length
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
try{
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
console.log('翻译结果:', data);
resolve(JSON.parse(data).trans_result[0].dst)
});
});
res.on('end', () => {
console.log('翻译结果:', data);
resolve(JSON.parse(data).trans_result[0].dst)
req.on('error', (err) => {
console.error(err);
});
});
req.on('error', (err) => {
console.error(err);
});
req.write(querystring.stringify(params));
req.end();
}catch (e) {
console.log(text + " 翻译失败:" + e)
}
req.write(querystring.stringify(params));
req.end();
})
};
......@@ -95,11 +99,19 @@ let autoTransCnt = 0
async function translate(obj){
// 对未翻译内容调用百度翻译进行翻译操作,有变量的不做处理
for(let text in obj){
if(obj[text] || text.includes('{'))continue
const textEn = await translateText(text)
console.log(`${text} => ${textEn}\n`)
obj[text] = textEn
autoTransCnt ++
if(obj[text] || text.trim() === '')continue
try{
const textEn = await translateText(text)
console.log(`${text} => ${textEn}\n`)
obj[text] = textEn
autoTransCnt ++
// 每次翻译后保存一次,防止意外退出导致的数据丢失
fs.writeFileSync(savePath, JSON.stringify(obj, null, 4))
}catch (e) {
console.log(text + " 翻译失败:" + e)
}
// 账号请求频率限制1ps
await new Promise(resolve => setTimeout(resolve, 1000))
......
......@@ -1023,3 +1023,12 @@ export function getParentOrder(orderId){
method: 'get'
})
}
// 获取订单入仓商品明细通用属性集合,用于备货选择订单商品到明细
export function getOrderItemCommonAttr(orderId, excludeOrderWarehouseInId){
return request({
url: '/order/order-warehouse-in/get-order-warehouse-in-common-attr-list',
method: 'get',
params: {orderId, excludeOrderWarehouseInId}
})
}
This diff is collapsed.
This diff is collapsed.
......@@ -485,10 +485,10 @@
// 执行导出
this.exportLoading = true;
exportDetailExcel(params).then(response => {
this.$download.excel(response, `${this.$t('业绩明细')}.xls`);
this.exportLoading = false;
}).catch(() => {
// this.$download.excel(response, `${this.$t('业绩明细')}.xls`);
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
}).finally(() => {
this.exportLoading = false;
});
},
/** 导出按钮操作 */
......
......@@ -756,6 +756,10 @@ export default {
if(row['discountFreightPrice'] && row['discountFreightPrice'] > 0){
freightFields.push({field: 'afterDiscountSeaFreight', label: this.$t('优惠后单价')})
}
// 包装加价
if(row['packagingFreightPrice'] && row['packagingFreightPrice'] > 0){
freightFields.push({field: 'packagingFreightPrice', label: this.$t('包装加价')})
}
freightFields.push({field: 'oneSeaFreight', label: this.$t('成交单价')})
console.log({freightFields})
freightFields.forEach(item => {
......@@ -790,6 +794,10 @@ export default {
if(row['discountClearanceFeePrice'] && row['discountClearanceFeePrice'] > 0){
clearanceFields.push({field: 'afterDiscountClearanceFreight', label: this.$t('优惠后单价')})
}
// 包装加价
if(row['packagingClearanceFeePrice'] && row['packagingClearanceFeePrice'] > 0){
clearanceFields.push({field: 'packagingClearanceFeePrice', label: this.$t('包装加价')})
}
clearanceFields.push({field: 'oneClearanceFreight', label: this.$t('成交单价')})
clearanceFields.forEach(item => {
if(row[item.field]){
......
......@@ -896,13 +896,20 @@ export default {
}
},
// 目的地
'form.objectiveId'(objectiveId, oldObjectiveId){
this.getOpenedRouterList()
// 修改目的地后需要重新选择路线
if(oldObjectiveId && oldObjectiveId != objectiveId && !this.initing){
console.log('修改目的地,重置lineId', oldObjectiveId, objectiveId)
async 'form.objectiveId'(objectiveId, oldObjectiveId){
// 重新获取路线
await this.getOpenedRouterList()
// 如果已选择的路线不在可用路线里则重置
if(this.form.lineId && !this.routerList.find(item => item.id == this.form.lineId)){
this.$set(this.form, 'lineId', null)
}
// 重新获取渠道
await this.getChannelList()
// 如果已选择的渠道不在可用渠道里则重置
if(this.form.channelId && !this.channelList.find(item => item.channelId == this.form.channelId)){
this.$set(this.form, 'channelId', null)
}
},
'form.transportId'(transportId, oldTransportId){
// 空运
......@@ -941,11 +948,19 @@ export default {
if(this.form.lineId) this.getOfferData()
// 选择渠道后需要筛选目的城市和线路
// 有点卡,改异步
this.$nextTick(() => {
this.$nextTick(async () => {
// 更新目的城市备选
this.getTradeCity()
await this.getTradeCity()
// 如果已选择城市,在切换后不可用则重置
if(this.form.objectiveId && !this.importList.find(item => item.id == this.form.objectiveId)){
this.$set(this.form, 'objectiveId', null)
}
// 更新线路备选
this.getOpenedRouterList()
await this.getOpenedRouterList()
// 如果已选择路线且切换后原路线不可用则重置
if(this.form.lineId && !this.routerList.find(item => item.id == this.form.lineId)){
this.$set(this.form, 'lineId', null)
}
})
},
'form.consigneeCountryCode'(){
......@@ -1093,7 +1108,7 @@ export default {
})
this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data
await this.getChannelList()
await this.getTradeCity()
this.currencyList = (await getCurrencyList()).data
this.unitList = (await getUnitList()).data
......@@ -1125,6 +1140,12 @@ export default {
}
this.tradeCityList = (await getTradeCityList(query)).data
},
async getChannelList(){
let query = {
cityId: this.form.objectiveId
}
this.channelList = (await getChannelList(query)).data
},
onTableMounted(e){
// console.warn('onTableMounted', e)
},
......
<template>
<el-dialog
:title="$t('选择订单商品')"
:visible.sync="visible"
append-to-body
width="90vw"
>
<el-table ref="multipleTable" :data="orderItemDetails" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column :label="$t('品名')" prop="name">
<template #default="{row}">{{$l(row, "prodName")}}</template>
</el-table-column>
<el-table-column :label="$t('品牌')" prop="brand">
<template #default="{row}">{{$l(row, "brandName")}}</template>
</el-table-column>
<el-table-column :label="$t('材质')" prop="material">
<template #default="{row}">{{$l(row, "materialLabel")}}</template>
</el-table-column>
<el-table-column :label="$t('商品特性')" prop="attr">
<template #default="{row}">{{$l(row, "prodAttrNames")}}</template>
</el-table-column>
<el-table-column :label="$t('用途')" prop="unit">
<template #default="{row}">{{$l(row, "usageNames")}}</template>
</el-table-column>
<el-table-column :label="$t('数量')" prop="quantityAll"></el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit">{{$t('确定')}}</el-button>
<el-button @click="handleClose">{{$t('取消')}}</el-button>
</div>
</el-dialog>
</template>
<script>
import ProductSelector from "@/components/ProductSelector"
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"
import {getFeeTypeByOrderProduct, getProductBrankPage} from "@/api/ecw/productBrank"
import {cancelProcessInstance} from "@/api/bpm/processInstance"
import WorkFlow from "@/components/WorkFlow"
import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict"
import {finishPacked, getOrderItemCommonAttr, orderWarehouseIn, orderWarehouseInUpdateApply} from "@/api/ecw/order"
import {getProductAttrList} from "@/api/ecw/productAttr"
import {getProductTypeList} from "@/api/ecw/productType"
import {addProduct} from "@/api/ecw/product"
import WarehouseRecordDetail from "@/views/ecw/order/warehousing/components/WarehouseRecordDetail.vue";
import ImageAndVideoUpload from "@/components/ImageAndVideoUpload/index.vue";
import Template from "@/views/cms/template/index.vue";
export default {
props: {
orderId: {
type: Number,
default: undefined
},
warehouseInId:Number
},
data(){
return {
visible: true,
// 备选的商品明细
orderItemDetails: [],
multipleSelection:[]
}
},
watch:{
visible(val){
if (!val) {
this.$emit('close')
}
},
},
async created() {
getOrderItemCommonAttr(this.orderId, this.warehouseInId).then(res => {
this.orderItemDetails = res.data
})
},
methods: {
handleSelectionChange(e){
console.log("handleSelectionChange", e)
this.multipleSelection = e
},
handleSubmit(){
// 品名+品牌+材质+商品特性+用途一致的会合并,数量累加
// https://zentao.test.jdshangmen.com/task-view-3423.html
let arr = []
this.multipleSelection.forEach(item => {
let index = arr.findIndex(i => {
return i.prodId == item.prodId && i.brand == item.brand && i.material == item.material && i.prodAttrIds == item.prodAttrIds && i.usageIds == item.usageIds
})
if (index == -1) {
arr.push({...item})
} else {
arr[index].quantityAll += item.quantityAll
}
})
this.$emit("success", arr)
},
handleClose() {
this.visible = false
}
}
}
</script>
<style scoped>
</style>
......@@ -196,7 +196,12 @@
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<WarehouseRecordDetail v-model="form.table[$index].orderWarehouseInDetailsVOList" />
<WarehouseRecordDetail
v-model="form.table[$index].orderWarehouseInDetailsVOList"
show-choose-order-item
:order-id="order.orderId"
:warehouse-in-id="row.id"
/>
<el-popconfirm
v-if="$index >= protectRowCount"
title="确定要删除该行记录吗?"
......@@ -469,7 +474,11 @@ export default {
this.form.type = this.warehousing.type
this.form.feeType = this.warehousing.feeType
this.form.usageIds = this.warehousing.usageIds?.split(',')
/* 下面的代码产生异常,且目的不明,先注释掉
if (this.usageIds.length > 0 && this.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
*/
this.warehousing.orderWarehouseInBackItemDoList.forEach(e => {
let bg = {}
if (e.boxGauge) {
......
......@@ -491,9 +491,9 @@ export default {
this.$message.success(this.$t('操作成功'))
})
},
// 退仓
// 并箱
async rollback(orderItem){
this.$confirm(this.$l(orderItem, 'prodTitle') + this.$t("退仓后不可恢复,是否确认退仓"), this.$t('提示')).then(() => {
this.$confirm(this.$l(orderItem, 'prodTitle') + this.$t("并箱后不可恢复,是否确认并箱"), this.$t('提示')).then(() => {
return rollbackDelete({
orderId: this.orderId,
orderItemId: orderItem.orderItemId,
......
......@@ -12,6 +12,13 @@
:visible.sync="dialogVisible"
width="1024px"
:before-close="handleClose">
<template v-slot:title>
<div class="flex flex-items-center">
<div class="title flex-1 flex flex-items-center">{{$t('选择订单商品')}}</div>
<el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">选择订单商品</el-button>
<div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div>
</div>
</template>
<el-form v-if="dialogVisible">
<WarehouseRecordDetailItem
......@@ -30,6 +37,12 @@
<el-button type="primary" @click="handleSave">确 定</el-button>
</span>
</el-dialog>
<choose-order-products
v-if="showChooseDialog"
:order-id="orderId"
:warehouse-in-id="warehouseInId"
@close="showChooseDialog=false"
@success="handleChooseOrderProducts"></choose-order-products>
</div>
</template>
......@@ -37,13 +50,15 @@
import ProductSelector from "@/components/ProductSelector/index.vue";
import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue";
import {getProductAttrList} from "@/api/ecw/productAttr";
import {getOrderItemCommonAttr} from "@/api/ecw/order";
import ChooseOrderProducts from "@/views/ecw/order/stocking/components/ChooseOrderProducts.vue";
/**
* 入仓明细弹窗
*/
export default {
name: 'WarehouseRecordDetail',
components: {WarehouseRecordDetailItem, ProductSelector},
components: {ChooseOrderProducts, WarehouseRecordDetailItem, ProductSelector},
props: {
value: {
......@@ -61,7 +76,11 @@ export default {
num:{
type:Number,
default:0
}
},
// 是否显示添加订单商品按钮
showChooseOrderItem:Boolean,
orderId: Number,
warehouseInId: Number
},
data() {
......@@ -69,7 +88,8 @@ export default {
dialogVisible: false,
dataList: [],
// 特性列表
attrList: []
attrList: [],
showChooseDialog: false
};
},
......@@ -158,6 +178,40 @@ export default {
}
this.$emit('input', this.dataList)
this.dialogVisible = false
},
handleShowChooseDialog(){
this.showChooseDialog = true
},
handleChooseOrderProducts(data){
this.showChooseDialog = false
if(!data?.length) return
// 如果最后一条是空的,则删除先
if(this.dataList?.length){
const index = this.dataList.length - 1
let lastItem = this.dataList[index]
if(!lastItem.prodId && !lastItem.brand && !lastItem.prodAttrIds && !lastItem.material && !lastItem.quantityAll){
this.dataList.splice(index, 1)
}
}
data.forEach(item => {
this.dataList.push({
"boxGauge": "",
"brand": item.brand,
"cartonsNum": undefined,
"createTime": "",
"expressNo": "",
"prodAttrIds": item.prodAttrIds,
"prodId": item.prodId,
"quantityAll": item.quantityAll,
"specificationType": undefined,
"unit": "",
"usageIds": item.usageIds || "",
"volume": undefined,
"weight": undefined,
"material": item.material
})
})
}
},
......@@ -173,5 +227,7 @@ export default {
</script>
<style scoped lang="scss">
.title{
font-size: 16px;
}
</style>
......@@ -153,16 +153,14 @@ export default {
}
if(this.value.material){
this.material = this.value.material
this.$set(this, 'material', this.value.material)
}
if (typeof this.value.prodAttrIds === 'string' && this.value.prodAttrIds.length > 0) {
this.prodAttrIds = this.value.prodAttrIds.split(',').map(e => +e)
}
console.log(this.prodAttrIds)
if (this.value.usageIds) {
await this.$nextTick()
this.usageIds = this.value.usageIds.split(',') || []
}
......@@ -246,7 +244,23 @@ export default {
if (this.value.weight < 0) {
this.value.weight = -this.value.weight
}
}
},
'value.brand'(val){
if(!val) return
const index = this.brandList.findIndex(item => item.id == val)
getProductBrank(val).then(res => {
this.brandList.push(res.data)
})
},
"value.usageIds"(val) {
this.usageIds = val?.split(',') || []
if (this.usageIds.length > 0 && this.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
},
"value.material"(val) {
this.material = val
},
}
}
</script>
......
This diff is collapsed.
......@@ -102,21 +102,34 @@ export default {
const index = this.index
const errors = []
// 区间设置检查
if(index > 0 && !this.value.startNum){
errors.push(`请设置${this.priceName}${index+1}阶段的起始值`)
if(typeof this.value.startNum != "number"){
errors.push(this.$t("请设置{priceName}第{index}阶段的起始值", {
index: index + 1,
priceName: this.priceName
}))
}
if(!this.value.endNum){
errors.push(`请设置${this.priceName}${index+1}阶段的结束值`)
errors.push(this.$t("请设置{priceName}第{index}阶段的结束值", {
index: index + 1,
priceName: this.priceName
}))
}
// 价格检查
if(!this.validatePrice(this.value[`${this.fieldPrefix}Price`])){
errors.push(`请设置第${index+1}阶段的${this.priceName}`)
errors.push(this.$t("请设置第{index}阶段的{priceName}", {
index: index+1,
priceName: this.priceName
}))
}
// 包装价格检查
if(this.value.packagingList?.length){
this.value.packagingList.forEach((item, i) => {
if(item.packagingTypes?.length && !this.validatePrice(item.packagingPrice)){
errors.push(`请设置第${index+1}阶段的包装类型${i+1}${this.priceName}`)
errors.push(this.$t("请设置第{index}阶段的包装类型{i}的{priceName}", {
index: index+1,
i: i+1,
priceName: this.priceName
}))
}
})
}
......
......@@ -371,12 +371,14 @@ export default {
if(this.form.stepPrice === 1){
this.initStepPrice()
}
this.syncMinWeightUnit()
},
'form.stepPrice'(stepPrice){
if(this.form.stepPrice === 1){
this.initStepPrice()
}
this.stepPrice = !!stepPrice
this.syncMinWeightUnit()
},
needPay(val){
this.$set(this.form, 'needPay', val ? 1 : 0)
......@@ -521,6 +523,21 @@ export default {
})
},
methods: {
// 设置最小起计量单位
syncMinWeightUnit(){
// 如果是阶梯价
if(this.form.stepPrice){
const field = this.form.priceType === 1 ? "fullPriceStepList" : "freightPriceStepList"
const stepPriceList = this.form[field]
if(stepPriceList?.length){
this.form.minWeightUnit = stepPriceList[0]?.weightUnit || DEFAULT_WEIGHT_UNIT
}else {
this.form.minWeightUnit = DEFAULT_WEIGHT_UNIT
}
}else{
this.form.minWeightUnit = this.form[this.form.priceType === 1 ? 'allVolumeUnit' : 'transportVolumeUnit'] || DEFAULT_WEIGHT_UNIT
}
},
handleAddPrice(field, fieldPrefix){
if(!this.form[field]){
this.$set(this.form, field, [])
......@@ -593,11 +610,18 @@ export default {
},
// 非阶梯价格更新单位
handleFormUnitChange(data){
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
if(this.form.specialList?.length){
this.form.specialList.forEach(p => {
p[data.field] = data.value
})
}
// TODO 等加了包装之后还需要同步包装的单位
},
initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
......
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