Commit 5e4ea432 authored by 邓春圆's avatar 邓春圆

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

parents 9e67c1ee d8a986e6
......@@ -40,7 +40,7 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => {
'Content-Length': querystring.stringify(params).length
}
};
try{
const req = https.request(options, (res) => {
let data = '';
......@@ -60,6 +60,10 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => {
req.write(querystring.stringify(params));
req.end();
}catch (e) {
console.log(text + " 翻译失败:" + e)
}
})
};
......@@ -96,11 +100,19 @@ async function translate(obj){
// 对未翻译内容调用百度翻译进行翻译操作,有变量的不做处理
for(let text in obj){
if(obj[text] || text.includes('{'))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))
}
......
......@@ -1025,9 +1025,10 @@ export function getParentOrder(orderId){
}
// 获取订单入仓商品明细通用属性集合,用于备货选择订单商品到明细
export function getOrderItemCommonAttr(orderId){
export function getOrderItemCommonAttr(orderId, excludeOrderWarehouseInId){
return request({
url: '/order/order-warehouse-in/get-order-warehouse-in-common-attr-list?orderId=' + orderId,
method: 'get'
url: '/order/order-warehouse-in/get-order-warehouse-in-common-attr-list',
method: 'get',
params: {orderId, excludeOrderWarehouseInId}
})
}
This diff is collapsed.
......@@ -52,7 +52,8 @@ export default {
orderId: {
type: Number,
default: undefined
}
},
warehouseInId:Number
},
data(){
return {
......@@ -70,7 +71,7 @@ export default {
},
},
async created() {
getOrderItemCommonAttr(this.orderId).then(res => {
getOrderItemCommonAttr(this.orderId, this.warehouseInId || 0).then(res => {
this.orderItemDetails = res.data
})
},
......@@ -80,7 +81,21 @@ export default {
this.multipleSelection = e
},
handleSubmit(){
this.$emit("success", this.multipleSelection)
// 品名+品牌+材质+商品特性+用途一致的会合并,数量累加
// 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
......
......@@ -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" show-choose-order-item :order-id="order.orderId" />
<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) {
......
......@@ -67,7 +67,13 @@
</el-table-column>
<el-table-column prop="areaName" width="220px">
<template v-slot="{row}">
<WarehouseRecordDetail v-model="row.orderWarehouseInDetailsVOList" @input="saveDetail(props.row)" show-choose-order-item :order-id="orderId" />
<WarehouseRecordDetail
v-model="row.orderWarehouseInDetailsVOList"
@input="saveDetail(props.row)"
show-choose-order-item
:order-id="orderId"
:warehouse-in-id="row.id"
/>
<el-button class="pl-5 pr-5" size="mini" type="primary" @click="package(props.row, $t('修改打包'))">{{$t('修改')}}</el-button>
<el-button class="pl-5 pr-5" size="mini" type="danger" @click="package(props.row, $t('修改打包'))">{{$t('删除')}}</el-button>
</template>
......
......@@ -792,6 +792,9 @@ export default {
this.form.feeType = this.warehousing.feeType
this.form.pictureUrls = this.warehousing.pictureUrls
this.form.usageIds = this.warehousing.usageIds?.split(',') || []
if (this.form.usageIds.length > 0 && this.form.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
this.warehousing.orderWarehouseInBackItemDoList.forEach(e => {
let bg = {}
......
......@@ -37,7 +37,12 @@
<el-button type="primary" @click="handleSave">确 定</el-button>
</span>
</el-dialog>
<choose-order-products v-if="showChooseDialog" :order-id="orderId" @close="showChooseDialog=false" @success="handleChooseOrderProducts"></choose-order-products>
<choose-order-products
v-if="showChooseDialog"
:order-id="orderId"
:warehouse-in-id="warehouseInId"
@close="showChooseDialog=false"
@success="handleChooseOrderProducts"></choose-order-products>
</div>
</template>
......@@ -74,7 +79,8 @@ export default {
},
// 是否显示添加订单商品按钮
showChooseOrderItem:Boolean,
orderId: Number
orderId: Number,
warehouseInId: Number
},
data() {
......
......@@ -153,17 +153,18 @@ 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(',') || []
if (this.usageIds.length > 0 && this.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
}
if (this.value.boxGauge) {
......@@ -246,7 +247,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