Commit abd127f1 authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/dev' into dev

parents b891f236 b871f627
......@@ -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();
})
};
......@@ -96,10 +100,20 @@ 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(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.
......@@ -466,6 +466,12 @@ export default {
id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath
},
// 线路重量超限
line_weight_exception:{
component: () => import('@/views/ecw/order/exception/components/overweightException'),
id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath
},
}
console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim())
return map[this.processInstance.processDefinition.formCustomViewPath.trim()]
......
......@@ -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;
});
},
/** 导出按钮操作 */
......
......@@ -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)
},
......
......@@ -288,10 +288,10 @@ export default {
if(row.orderItemId){
var productData = this.orderData.orderItemVOList.find(item=>item.orderItemId==row.orderItemId)
if(productData){
if(row.orderExceptionType=='customs_fee_not_quote_exception'&&productData.prodId){
this.$router.push('/product/product-list?prodId=' + productData.prodId)
return
}else{
// if(row.orderExceptionType=='customs_fee_not_quote_exception'&&productData.prodId){
// this.$router.push('/product/product-list?prodId=' + productData.prodId)
// return
// }else{
getProduct(productData.prodId).then(res=>{
let params = {
product_id: productData.prodId,
......@@ -334,7 +334,7 @@ export default {
+'&exportCity='+this.orderData.logisticsInfoDto.startCityId+'&importCity='+this.orderData.logisticsInfoDto.destCityId */
})
}
// }
}
}else{
return this.$confirm(this.$t('数据缺少orderItemId参数,确定要跳转设置路线价格么?')).then(res => {
......
<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>
......
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