Commit 3869d907 authored by houjn@hikoon.cn's avatar houjn@hikoon.cn
parents bf548869 3a057409
......@@ -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,18 @@ 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 ++
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.
......@@ -30,6 +30,10 @@
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('业务编号')" prop="businessNo">
<el-input v-model="queryParams.businessNo" :placeholder="$t('请输入业务编号')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -126,6 +130,7 @@ export default {
category: null,
status: null,
result: null,
}
};
},
......
......@@ -18,6 +18,10 @@
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')"/>
</el-form-item>
<el-form-item :label="$t('业务编号')" prop="businessNo">
<el-input v-model="queryParams.businessNo" :placeholder="$t('请输入业务编号')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......
......@@ -21,10 +21,10 @@
type="daterange" range-separator="-" :start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"/>
</el-form-item>
<!-- el-form-item :label="$t('业务编号')" prop="businessNo">
<el-form-item :label="$t('业务编号')" prop="businessNo">
<el-input v-model="queryParams.businessNo" :placeholder="$t('请输入业务编号')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> -->
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t('重置') }}</el-button>
......
......@@ -209,11 +209,11 @@
<script>
import {
deletebox,
getbox,
getboxPage,
exportboxExcel,
getNoticeList, dealCustomsSplitNotify, exportSeaPreloadGoodsList, zipDownload,
deletebox,
getbox,
getboxPage,
exportboxExcel,
getNoticeList, dealCustomsSplitNotify, exportSeaPreloadGoodsList, zipDownload, downloadLoadGoodsList,
} from "@/api/ecw/box";
import {
downloadFile,
......@@ -498,12 +498,9 @@ export default {
this.exportExcel(exportSeaPreloadGoodsList, { shipmentId: row.id }, this.$t("预装单") + `(${row.selfNo}).xlsx`)
break;
case "downloadLoadGoodsList":
downloadFile(
command,
{ shipmentId: row.id },
this.$t("已装单") + `(${row.selfNo}).xlsx`,
"xlsx"
);
downloadLoadGoodsList({ shipmentId: row.id }).then(res => {
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
})
break;
case "downloadReceivableList":
downloadFile(
......
......@@ -108,10 +108,15 @@
<script>
import {
getMakeBillList,
makeBillService,
getBillService,
deleteBillService, zipDownload, downloadReceivableList, makeAirBillService, downloadAirReceivableList,
getMakeBillList,
makeBillService,
getBillService,
deleteBillService,
zipDownload,
downloadReceivableList,
makeAirBillService,
downloadAirReceivableList,
downloadLoadGoodsList,
} from "@/api/ecw/box";
import {
getTotlContent,
......@@ -217,12 +222,15 @@ export default {
});
break;
case "downloadLoadGoodsList":
downloadFile(
downloadLoadGoodsList({ shipmentId: this.shipmentObj.id }).then(res => {
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
})
/*downloadFile(
type,
{ shipmentId: this.shipmentObj.id },
this.$t("已装单") + `(${this.shipmentObj.selfNo}).xlsx`,
"xlsx"
);
);*/
return;
case "downloadReceivableList":
const api = this.type == 'air' ? downloadAirReceivableList : downloadReceivableList;
......
......@@ -25,16 +25,6 @@
<el-button :disabled="shipmentObj.approvaling" size="small" type="primary" @click="()=>tallyClick('batch')">{{$t('批量理货')}}</el-button>
<el-button :disabled="shipmentObj.approvaling" size="small" type="primary" @click="()=>removeClick('batch')">{{$t('批量移出')}}</el-button>
</div>
<div v-if="false">
<template>
<el-input v-model="qrCode" :placeholder="$t('请输入二维码/条码编号')" clearable></el-input>
<el-button type="primary" @click="handlerBatchCreate('single')">{{$t('确定')}}</el-button>
<el-button type="primary" @click="handlerClick('batchInput',$t('批量输入'))">{{$t('批量输入')}}</el-button>
<el-button type="primary" @click="handlerClick('correction',$t('理货纠错'))">{{$t('理货纠错')}}</el-button>
<el-button type="primary" @click="handlerClick('correctionOrder',$t('批量理货纠错'))">{{$t('批量理货纠错')}}</el-button>
</template>
</div>
</el-row>
<el-row style="margin-top: 5px">
<el-table border :data="tallyList" @select="checkboxSelect" @select-all="checkboxSelect" max-height="600px">
......@@ -135,76 +125,6 @@
append-to-body
@cancel="currentTurnExceptionOrder=null"
@success="currentTurnExceptionOrder=null" />
<!-- 对话框 -->
<el-dialog custom-class="shipping-dialog" :title="dialogConfig.title" :visible.sync="dialogConfig.dialogVisible" :fullscreen="dialogConfig.fullscreen" :width="dialogConfig.width" :modal-append-to-body=false append-to-body>
<!-- 装柜纠错 -->
<template v-if="dialogConfig.type === 'correction' && dialogConfig.dialogVisible">
<el-form ref="correctionForm" :rules="rules" :model="correctionObj" label-position="top">
<el-form-item :label="$t('装柜纠错(二维码/条形码编号)')" prop="qrCode">
<el-input v-model="correctionObj.qrCode" :placeholder="$t('请输入二维码/条形码编号')" clearable />
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit('correctionForm')">{{$t('提交')}}</el-button>
<el-button @click="closeDialog2">{{$t('取消')}}</el-button>
</el-row>
</template>
<!-- 批量装柜纠错(订单号) -->
<template v-if="dialogConfig.type === 'correctionOrder' && dialogConfig.dialogVisible">
<el-form ref="orderForm" :rules="rules" :model="orderObj" label-position="top">
<el-form-item :label="$t('装柜纠错') +'(' + $t('订单号') + ')'" prop="orderNo">
<el-input type="textarea" :rows="3" v-model="orderObj.orderNo" :placeholder="$t('请输入,多个以逗号分隔')" clearable />
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary" @click="onSubmit('orderForm')">{{$t('提交')}}</el-button>
<el-button @click="closeDialog2">{{$t('取消')}}</el-button>
</el-row>
</template>
<!-- 装柜批量输入 -->
<template v-if="dialogConfig.type === 'batchInput' && dialogConfig.dialogVisible">
<el-form ref="batchForm" :rules="rules" :model="batchObj">
<el-form-item label="" prop="qrCode" class="two-element">
<el-input v-model="batchObj.qrCode" :placeholder="$t('请输入订单号')" clearable />
<el-button style="marginLeft:10px;" type="primary" @click="queryOrderInfo">{{$t('确定')}}</el-button>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('订单号')">
{{boxOrderInfo.orderNo}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('箱数')">
<el-input-number v-if="boxOrderInfo.isExternalWarehouse === 1" v-model="batchObj.boxNum" :min="0" :max="boxOrderInfo.num" />
<template v-else>
{{boxOrderInfo.num}}
</template>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('方数')">
{{getTotlContent(boxOrderInfo, ['volume'])}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('重量')">
{{getTotlContent(boxOrderInfo, ['weight'])}}
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row class="operate-button">
<el-button type="primary" :disabled="boxOrderInfo.orderId ? false : true" @click="batchLoad">{{$t('提交')}}</el-button>
<el-button @click="closeDialog2">{{$t('取消')}}</el-button>
</el-row>
</template>
</el-dialog>
</div>
</template>
......
......@@ -59,27 +59,14 @@
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button type="primary" icon="el-icon-search" @click="resetQuery">{{$t('重置')}}</el-button>
<el-button @click="resetQuery">{{$t('重置')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportDetail" :loading="exportLoading" v-hasPermi="['ecw:achievement:export']">{{ $t('导出明细') }}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportStatistics" :loading="exportLoading" v-hasPermi="['ecw:achievement:export']">{{ $t('导出统计') }}</el-button>
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
>{{$t('导出')}}</el-button> -->
</el-form-item>
</el-form>
<div class="total_num">
<span>{{ $t('开发客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.developNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.developVolume}}</span>
<span>{{$t('总重量')}} {{totalData.developWeight}}KG </span>
<span>{{ $t('公司客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.companyNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.companyVolume}}</span>
<span>{{$t('总重量')}} {{totalData.companyWeight}}KG </span>
<span>{{ $t('汇总:') }}</span>
<span>{{$t('总箱数')}} {{totalData.sumNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.sumVolume}}</span>
<span>{{$t('总重量')}} {{totalData.sumWeight}}KG </span>
</div>
<total_num :total-data="totalData"></total_num>
<!-- 列表 -->
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column :label="$t('序号')" align="center" type="index"></el-table-column> -->
......@@ -145,10 +132,11 @@
import dayjs from "dayjs";
import {listServiceUser} from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse'
import Total_num from "@/views/ecw/deptTarget/total_num.vue";
export default {
name: "EcwDepttargetAllachievement",
components: {},
components: {Total_num},
data() {
return {
// 遮罩层
......@@ -219,6 +207,12 @@
sumWeight:0,
sumVolume:0,
sumNum:0,
newTotalNum:0,
newTotalVolume:0,
newTotalWeight:0,
oldTotalNum:0,
oldTotalVolume:0,
oldTotalWeight:0,
},
myAchievementData:{},
warehouseList:[]
......@@ -313,6 +307,12 @@
this.totalData.developWeight =this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum
this.$set(this.totalData,'newTotalNum',this.myAchievementData.newTotalNum ||0 )
this.$set(this.totalData,'newTotalVolume',this.myAchievementData.newTotalVolume || 0 )
this.$set(this.totalData,'newTotalWeight',this.myAchievementData.newTotalWeight || 0)
this.$set(this.totalData,'oldTotalNum',this.myAchievementData.oldTotalNum || 0)
this.$set(this.totalData,'oldTotalVolume',this.myAchievementData.oldTotalVolume || 0 )
this.$set(this.totalData,'oldTotalWeight',this.myAchievementData.oldTotalWeight || 0)
this.loading = false;
});
},
......@@ -350,7 +350,11 @@
this.dateRangeCreateTime = [];
this.dateRangeStartTime = [];
this.dateRangeEndTime = [];
this.resetForm("queryForm");
this.resetForm("queryParams");
this.queryParams = {
pageNo: 1,
pageSize: 10
}
this.handleQuery();
},
/** 新增按钮操作 */
......@@ -481,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;
});
},
/** 导出按钮操作 */
......@@ -516,7 +520,7 @@
.total_num{
display:flex;
align-items: center;
justify-content: center;
justify-content: left;
margin:20px 0;
font-size:15px;
}
......
......@@ -70,20 +70,7 @@
>{{$t('导出')}}</el-button> -->
</el-form-item>
</el-form>
<div class="total_num">
<span>{{ $t('开发客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.developNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.developVolume}}</span>
<span>{{$t('总重量')}} {{totalData.developWeight}}KG </span>
<span>{{ $t('公司客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.companyNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.companyVolume}}</span>
<span>{{$t('总重量')}} {{totalData.companyWeight}}KG </span>
<span>{{ $t('汇总:') }}</span>
<span>{{$t('总箱数')}} {{totalData.sumNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.sumVolume}}</span>
<span>{{$t('总重量')}} {{totalData.sumWeight}}KG </span>
</div>
<total_num :total-data="totalData"></total_num>
<!-- 列表 -->
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column :label="$t('序号')" align="center" type="index"></el-table-column> -->
......@@ -147,10 +134,11 @@
import dayjs from "dayjs";
import {listServiceUser} from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse'
import Total_num from "@/views/ecw/deptTarget/total_num.vue";
export default {
name: "EcwDepttargetMyachievement",
components: {},
components: {Total_num},
data() {
return {
// 遮罩层
......@@ -316,6 +304,12 @@
this.totalData.developWeight =this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum
this.$set(this.totalData,'newTotalNum',this.myAchievementData.newTotalNum ||0 )
this.$set(this.totalData,'newTotalVolume',this.myAchievementData.newTotalVolume || 0 )
this.$set(this.totalData,'newTotalWeight',this.myAchievementData.newTotalWeight || 0)
this.$set(this.totalData,'oldTotalNum',this.myAchievementData.oldTotalNum || 0)
this.$set(this.totalData,'oldTotalVolume',this.myAchievementData.oldTotalVolume || 0 )
this.$set(this.totalData,'oldTotalWeight',this.myAchievementData.oldTotalWeight || 0)
this.loading = false;
});
},
......
......@@ -69,20 +69,7 @@
>{{$t('导出')}}</el-button> -->
</el-form-item>
</el-form>
<div class="total_num">
<span>{{ $t('开发客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.developNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.developVolume}}</span>
<span>{{$t('总重量')}} {{totalData.developWeight}}KG </span>
<span>{{ $t('公司客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.companyNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.companyVolume}}</span>
<span>{{$t('总重量')}} {{totalData.companyWeight}}KG </span>
<span>{{ $t('汇总:') }}</span>
<span>{{$t('总箱数')}} {{totalData.sumNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.sumVolume}}</span>
<span>{{$t('总重量')}} {{totalData.sumWeight}}KG </span>
</div>
<total_num :total-data="totalData" ></total_num>
<!-- 列表 -->
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column :label="$t('序号')" align="center" type="index"></el-table-column> -->
......@@ -147,10 +134,11 @@
import dayjs from "dayjs";
import {listServiceUser} from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse'
import Total_num from "@/views/ecw/deptTarget/total_num.vue";
export default {
name: "EcwDepttargetMydeptachievement",
components: {},
components: {Total_num},
data() {
return {
// 遮罩层
......@@ -313,6 +301,12 @@
this.totalData.developWeight =this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum
this.$set(this.totalData,'newTotalNum',this.myAchievementData.newTotalNum ||0 )
this.$set(this.totalData,'newTotalVolume',this.myAchievementData.newTotalVolume || 0 )
this.$set(this.totalData,'newTotalWeight',this.myAchievementData.newTotalWeight || 0)
this.$set(this.totalData,'oldTotalNum',this.myAchievementData.oldTotalNum || 0)
this.$set(this.totalData,'oldTotalVolume',this.myAchievementData.oldTotalVolume || 0 )
this.$set(this.totalData,'oldTotalWeight',this.myAchievementData.oldTotalWeight || 0)
this.loading = false;
});
},
......@@ -491,14 +485,5 @@
<style scoped >
.total_num{
display:flex;
align-items: center;
justify-content: center;
margin:20px 0;
font-size:15px;
}
.total_num span{
margin: 0 8px;
}
</style>
<script>
export default {
name: "total_num",
props:{
totalData:{
type:Object,
default:()=>({})
}
}
}
</script>
<template>
<div>
<div class="total_num">
<span>{{ $t('新客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.newTotalNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.newTotalVolume}}</span>
<span>{{$t('总重量')}} {{totalData.newTotalWeight}}KG </span>
<span>{{ $t('旧客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.oldTotalNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.oldTotalVolume}}</span>
<span>{{$t('总重量')}} {{totalData.oldTotalWeight}}KG </span>
</div>
<div class="total_num">
<span>{{ $t('开发客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.developNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.developVolume}}</span>
<span>{{$t('总重量')}} {{totalData.developWeight}}KG </span>
<span>{{ $t('公司客户:') }}</span>
<span>{{$t('总箱数')}} {{totalData.companyNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.companyVolume}}</span>
<span>{{$t('总重量')}} {{totalData.companyWeight}}KG </span>
<span>{{ $t('汇总:') }}</span>
<span>{{$t('总箱数')}} {{totalData.sumNum}}{{$t('')}} </span>
<span>{{$t('总方数')}} {{totalData.sumVolume}}</span>
<span>{{$t('总重量')}} {{totalData.sumWeight}}KG </span>
</div>
</div>
</template>
<style scoped lang="scss">
.total_num{
display:flex;
align-items: center;
justify-content: left;
margin:20px 0;
font-size:15px;
}
.total_num span{
margin: 0 8px;
}
</style>
<template>
<el-dialog
:title="$t('选择订单商品')"
:visible.sync="visible"
append-to-body
width="90vw"
>
<el-table ref="multipleTable" :data="flatList" @selection-change="handleSelectionChange" :span-method="objectSpanMethod" class="table">
<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-column :label="$t('总箱数')" prop="cartonsNum"></el-table-column>
<el-table-column :label="$t('包装类型')" prop="specificationType">
<template #default="{row}">
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" :value="row.specificationType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('规格')" prop="boxGauge"></el-table-column>
<el-table-column :label="$t('总重量')" prop="weight"></el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('影像')" prop="quantityAll">
<template #default="{row}">
<el-button type="text" @click="curPictrues = row.pictureUrls">{{$t('查看影像')}}</el-button>
</template>
</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>
<media-dialog v-if="curPictrues" :value="curPictrues" @close="curPictrues=null"></media-dialog>
</el-dialog>
</template>
<script>
import {getOrderItemCommonAttr} from "@/api/ecw/order"
import MediaDialog from "@/views/ecw/order/stocking/components/MediaDialog.vue";
export default {
components: {MediaDialog},
props: {
orderId: {
type: Number,
default: undefined
},
warehouseInId:Number
},
data(){
return {
visible: true,
// 备选的商品明细
orderItemDetails: [],
multipleSelection:[],
curPictrues: null
}
},
watch:{
visible(val){
if (!val) {
this.$emit('close')
}
},
},
computed:{
flatList(){
let arr = []
this.orderItemDetails.forEach(item => {
item.orderWarehouseInCommonAttrVOList?.forEach((vo, index) => {
arr.push({...item, ...vo, index, span: index === 0 ? item.orderWarehouseInCommonAttrVOList?.length : 0})
})
})
return arr
}
},
async created() {
getOrderItemCommonAttr(this.orderId, this.warehouseInId || 0).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
},
objectSpanMethod({ row, column, rowIndex, columnIndex }){
if(columnIndex > 6){
return {
rowspan: row.span,
colspan: 1
}
}
return {
rowspan: 1,
colspan: 1
}
}
}
}
</script>
<style scoped lang="scss">
.table{
::v-deep{
th.el-table__cell.is-leaf, td.el-table__cell{
border-bottom: 1px solid #9b9b9b;
}
.el-checkbox__inner{
border:2px solid #9b9b9b;
}
}
}
</style>
......@@ -40,7 +40,7 @@ export default {
</script>
<template>
<el-dialog :visible.sync="show" :before-close="onBeforeClose">
<el-dialog :visible.sync="show" :before-close="onBeforeClose" append-to-body :title="$t('查看影像')">
<image-and-video-upload v-model="pictureUrls" readonly></image-and-video-upload>
</el-dialog>
</template>
<template>
<el-dialog
<el-dialog
:title="$t('添加新品名')"
:visible.sync="visible"
width="90vw"
......
......@@ -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) {
......
......@@ -65,9 +65,15 @@
<el-button type="text" @click="showMedia(props.row)">{{$t('查看')}}</el-button>
</template>
</el-table-column>
<el-table-column prop="areaName" :label="$t(' ')" width="220px">
<el-table-column prop="areaName" width="220px">
<template v-slot="{row}">
<WarehouseRecordDetail v-model="row.orderWarehouseInDetailsVOList" @input="saveDetail(props.row)" />
<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>
......@@ -168,7 +174,9 @@
</template>
<el-button class="pl-5 pr-5" v-else size="mini" type="primary" @click="package(row, $t('修改打包'))">{{$t('修改打包')}}</el-button>
<el-button size="mini" type="danger" @click="rollback(row)">{{$t('退仓')}}</el-button>
<el-tooltip :content="$t('请确认货物打包完成再并箱')" :value="true" manual>
<el-button size="mini" type="danger" @click="rollback(row)">{{$t('并箱')}}</el-button>
</el-tooltip>
<el-button class="pl-5 pr-5" size="mini" type="info" @click="printTag">{{$t('打印标签')}}</el-button>
</el-button-group>
</template>
......@@ -491,9 +499,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,
......
......@@ -783,7 +783,6 @@ export default {
|| this.warehousing.prodAttrIds?.split(',').map(e => +e)
|| []
}
this.form.prodId = this.warehousing.prodId
this.form.prodTitleEn = this.warehousing.prodTitleEn
this.form.prodTitleZh = this.warehousing.prodTitleZh
......@@ -791,8 +790,10 @@ export default {
this.form.type = this.warehousing.type
this.form.feeType = this.warehousing.feeType
this.form.pictureUrls = this.warehousing.pictureUrls
this.form.usageIds = this.warehousing.usageIds?.split(',') || []
this.form.usageIds = this.warehousing.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 = {}
if (e.boxGauge) {
......
......@@ -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,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