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') => { ...@@ -40,7 +40,7 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => {
'Content-Length': querystring.stringify(params).length 'Content-Length': querystring.stringify(params).length
} }
}; };
try{
const req = https.request(options, (res) => { const req = https.request(options, (res) => {
let data = ''; let data = '';
...@@ -60,6 +60,10 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => { ...@@ -60,6 +60,10 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => {
req.write(querystring.stringify(params)); req.write(querystring.stringify(params));
req.end(); req.end();
}catch (e) {
console.log(text + " 翻译失败:" + e)
}
}) })
}; };
...@@ -96,11 +100,19 @@ async function translate(obj){ ...@@ -96,11 +100,19 @@ async function translate(obj){
// 对未翻译内容调用百度翻译进行翻译操作,有变量的不做处理 // 对未翻译内容调用百度翻译进行翻译操作,有变量的不做处理
for(let text in obj){ for(let text in obj){
if(obj[text] || text.includes('{'))continue if(obj[text] || text.includes('{'))continue
try{
const textEn = await translateText(text) const textEn = await translateText(text)
console.log(`${text} => ${textEn}\n`) console.log(`${text} => ${textEn}\n`)
obj[text] = textEn obj[text] = textEn
autoTransCnt ++ autoTransCnt ++
// 每次翻译后保存一次,防止意外退出导致的数据丢失
fs.writeFileSync(savePath, JSON.stringify(obj, null, 4))
}catch (e) {
console.log(text + " 翻译失败:" + e)
}
// 账号请求频率限制1ps // 账号请求频率限制1ps
await new Promise(resolve => setTimeout(resolve, 1000)) await new Promise(resolve => setTimeout(resolve, 1000))
} }
......
...@@ -1025,9 +1025,10 @@ export function getParentOrder(orderId){ ...@@ -1025,9 +1025,10 @@ export function getParentOrder(orderId){
} }
// 获取订单入仓商品明细通用属性集合,用于备货选择订单商品到明细 // 获取订单入仓商品明细通用属性集合,用于备货选择订单商品到明细
export function getOrderItemCommonAttr(orderId){ export function getOrderItemCommonAttr(orderId, excludeOrderWarehouseInId){
return request({ return request({
url: '/order/order-warehouse-in/get-order-warehouse-in-common-attr-list?orderId=' + orderId, url: '/order/order-warehouse-in/get-order-warehouse-in-common-attr-list',
method: 'get' method: 'get',
params: {orderId, excludeOrderWarehouseInId}
}) })
} }
This diff is collapsed.
...@@ -52,7 +52,8 @@ export default { ...@@ -52,7 +52,8 @@ export default {
orderId: { orderId: {
type: Number, type: Number,
default: undefined default: undefined
} },
warehouseInId:Number
}, },
data(){ data(){
return { return {
...@@ -70,7 +71,7 @@ export default { ...@@ -70,7 +71,7 @@ export default {
}, },
}, },
async created() { async created() {
getOrderItemCommonAttr(this.orderId).then(res => { getOrderItemCommonAttr(this.orderId, this.warehouseInId || 0).then(res => {
this.orderItemDetails = res.data this.orderItemDetails = res.data
}) })
}, },
...@@ -80,7 +81,21 @@ export default { ...@@ -80,7 +81,21 @@ export default {
this.multipleSelection = e this.multipleSelection = e
}, },
handleSubmit(){ 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() { handleClose() {
this.visible = false this.visible = false
......
...@@ -196,7 +196,12 @@ ...@@ -196,7 +196,12 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}"> <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 <el-popconfirm
v-if="$index >= protectRowCount" v-if="$index >= protectRowCount"
title="确定要删除该行记录吗?" title="确定要删除该行记录吗?"
...@@ -469,7 +474,11 @@ export default { ...@@ -469,7 +474,11 @@ export default {
this.form.type = this.warehousing.type this.form.type = this.warehousing.type
this.form.feeType = this.warehousing.feeType this.form.feeType = this.warehousing.feeType
this.form.usageIds = this.warehousing.usageIds?.split(',') 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 => { this.warehousing.orderWarehouseInBackItemDoList.forEach(e => {
let bg = {} let bg = {}
if (e.boxGauge) { if (e.boxGauge) {
......
...@@ -67,7 +67,13 @@ ...@@ -67,7 +67,13 @@
</el-table-column> </el-table-column>
<el-table-column prop="areaName" width="220px"> <el-table-column prop="areaName" width="220px">
<template v-slot="{row}"> <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="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> <el-button class="pl-5 pr-5" size="mini" type="danger" @click="package(props.row, $t('修改打包'))">{{$t('删除')}}</el-button>
</template> </template>
......
...@@ -792,6 +792,9 @@ export default { ...@@ -792,6 +792,9 @@ export default {
this.form.feeType = this.warehousing.feeType this.form.feeType = this.warehousing.feeType
this.form.pictureUrls = this.warehousing.pictureUrls this.form.pictureUrls = this.warehousing.pictureUrls
this.form.usageIds = this.warehousing.usageIds?.split(',') || [] 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 => { this.warehousing.orderWarehouseInBackItemDoList.forEach(e => {
let bg = {} let bg = {}
......
...@@ -37,7 +37,12 @@ ...@@ -37,7 +37,12 @@
<el-button type="primary" @click="handleSave">确 定</el-button> <el-button type="primary" @click="handleSave">确 定</el-button>
</span> </span>
</el-dialog> </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> </div>
</template> </template>
...@@ -74,7 +79,8 @@ export default { ...@@ -74,7 +79,8 @@ export default {
}, },
// 是否显示添加订单商品按钮 // 是否显示添加订单商品按钮
showChooseOrderItem:Boolean, showChooseOrderItem:Boolean,
orderId: Number orderId: Number,
warehouseInId: Number
}, },
data() { data() {
......
...@@ -153,17 +153,18 @@ export default { ...@@ -153,17 +153,18 @@ export default {
} }
if(this.value.material){ 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) { if (typeof this.value.prodAttrIds === 'string' && this.value.prodAttrIds.length > 0) {
this.prodAttrIds = this.value.prodAttrIds.split(',').map(e => +e) this.prodAttrIds = this.value.prodAttrIds.split(',').map(e => +e)
} }
console.log(this.prodAttrIds)
if (this.value.usageIds) { if (this.value.usageIds) {
await this.$nextTick()
this.usageIds = this.value.usageIds.split(',') || [] this.usageIds = this.value.usageIds.split(',') || []
if (this.usageIds.length > 0 && this.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
} }
if (this.value.boxGauge) { if (this.value.boxGauge) {
...@@ -246,7 +247,23 @@ export default { ...@@ -246,7 +247,23 @@ export default {
if (this.value.weight < 0) { if (this.value.weight < 0) {
this.value.weight = -this.value.weight 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> </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