Commit 497e23d3 authored by 我在何方's avatar 我在何方
parents 69426a1d 61d2ddee
...@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站 ...@@ -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 VUE_CLI_BABEL_TRANSPILE_MODULES = true
...@@ -18,4 +18,4 @@ VUE_APP_TENANT_ENABLE = false ...@@ -18,4 +18,4 @@ VUE_APP_TENANT_ENABLE = false
VUE_APP_DOC_ENABLE = true VUE_APP_DOC_ENABLE = true
# 百度统计 # 百度统计
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
\ No newline at end of file
...@@ -40,26 +40,30 @@ const translateText = (text, fromLang = 'zh', toLang = 'en') => { ...@@ -40,26 +40,30 @@ 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 = '';
res.on('data', (chunk) => { res.on('data', (chunk) => {
data += chunk; data += chunk;
});
res.on('end', () => {
console.log('翻译结果:', data);
resolve(JSON.parse(data).trans_result[0].dst)
});
}); });
res.on('end', () => { req.on('error', (err) => {
console.log('翻译结果:', data); console.error(err);
resolve(JSON.parse(data).trans_result[0].dst)
}); });
});
req.on('error', (err) => { req.write(querystring.stringify(params));
console.error(err); req.end();
}); }catch (e) {
console.log(text + " 翻译失败:" + e)
}
req.write(querystring.stringify(params));
req.end();
}) })
}; };
...@@ -95,11 +99,19 @@ let autoTransCnt = 0 ...@@ -95,11 +99,19 @@ let autoTransCnt = 0
async function translate(obj){ async function translate(obj){
// 对未翻译内容调用百度翻译进行翻译操作,有变量的不做处理 // 对未翻译内容调用百度翻译进行翻译操作,有变量的不做处理
for(let text in obj){ for(let text in obj){
if(obj[text] || text.includes('{'))continue if(obj[text] || text.trim() === '')continue
const textEn = await translateText(text) try{
console.log(`${text} => ${textEn}\n`) const textEn = await translateText(text)
obj[text] = textEn console.log(`${text} => ${textEn}\n`)
autoTransCnt ++ obj[text] = textEn
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))
......
...@@ -1023,3 +1023,12 @@ export function getParentOrder(orderId){ ...@@ -1023,3 +1023,12 @@ export function getParentOrder(orderId){
method: 'get' 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}
})
}
...@@ -3889,7 +3889,7 @@ ...@@ -3889,7 +3889,7 @@
"公司中文名称": "Chinese name of the company", "公司中文名称": "Chinese name of the company",
"展示": "show", "展示": "show",
"无归属订单": "Unassigned Order", "无归属订单": "Unassigned Order",
"最多可放入{quantity}": "", "最多可放入{quantity}": "Up to {quantity} can be placed",
"可放入仓方数": "Number of storage units that can be placed", "可放入仓方数": "Number of storage units that can be placed",
"可放入收费方数": "Number of charging parties that can be placed", "可放入收费方数": "Number of charging parties that can be placed",
"入仓方数": "Number of parties entering the warehouse", "入仓方数": "Number of parties entering the warehouse",
...@@ -4348,5 +4348,211 @@ ...@@ -4348,5 +4348,211 @@
"已下载": "Downloaded", "已下载": "Downloaded",
"待下载": "To be downloaded", "待下载": "To be downloaded",
"重试": "retry ", "重试": "retry ",
"会员详情": "Member Details" "会员详情": "Member Details",
} "全部清除": "Clear All",
"确定要全部清除么?": "Are you sure you want to clear all?",
"已选择{n}条路线": "{n} routes have been selected",
"清关费加价": "Customs clearance fee markup",
"撤销理由": "Reason for revocation",
"我司承接": "Our company undertakes",
"客户自清": "Customer self clearance",
"请选择目的港清关": "Please select the destination port for customs clearance",
"请选择发货方式": "Please select the shipping method",
"方数(分拣/已装)": "Quantity (sorted/loaded)",
"重量(分拣/已装)": "Weight (sorted/loaded)",
"起飞时间": "Takeoff time",
"此出货单状态未到提单节点": "This shipment status has not arrived at the bill of lading node",
"刷新成功": "Refresh successful",
"更新所选订单到港状态": "Update selected order arrival status",
"更新全部订单到港状态": "Update all order arrival status",
"更新所选订单清关状态": "Update the customs clearance status of the selected order",
"更新全部订单清关状态": "Update the customs clearance status of all orders",
"撤销清关申请": "Revoke customs clearance application",
"更新起飞异常状态": "Update takeoff abnormal status",
"操作步骤必填": "Operation steps are mandatory",
"票异常必填": "Ticket Exception Required",
"是否更新订单动态": "Update order dynamics",
"到港情况": "Arrival situation",
"一次到港": "One arrival at the port",
"多次到港": "Multiple arrivals to the port",
"已到港订单": "Orders that have arrived at the port",
"关键字:": "Keywords:",
"请输入订单号、提单号、唛头": "Please enter the order number, bill of lading number, and shipping mark",
"到港状态": "Arrival status",
"未到港": "Not arrived at the port",
"批量选择": "Batch selection",
"控货中": "In control of goods",
"已放完货": "The goods have been released completely",
"部分控货": "Partial control of goods",
"请先选择订单": "Please select the order first",
"订舱代理": "Booking Agent",
"请选择订舱代理": "Please select a booking agent",
"出仓箱数": "Number of outgoing boxes",
"出仓件数与计划出仓件数不一致,请检查": "The number of outgoing items does not match the planned number of outgoing items. Please check",
"清关情况": "Customs clearance situation",
"一次清关": "One customs clearance",
"多次清关": "Multiple customs clearances",
"已清关订单": "Customs cleared orders",
"已清关": "Customs cleared",
"封箱标签": "Sealing label",
"长度保留两位小数": "Length to two decimal places",
"cm": "Cm",
"宽度保留两位小数": "Width to two decimal places",
"高度保留两位小数": "Height to two decimal places",
"全部分拣": "Sort All",
"分拣柜": "Sorting cabinet",
"泡货比": "Bubble ratio",
"(混箱)": "(Mixed box)",
"箱明细": "Box details",
"理货纠错": "Tallying correction",
"批量理货纠错": "Batch tally correction",
"预计二程起飞时间": "Estimated departure time for the second leg",
"请先通过完成到仓审核": "Please complete the warehouse audit first",
"提交完成到仓审核": "Submit for warehouse review upon completion",
"到仓审核中": "In warehouse review",
"请选择到仓时间": "Please select the time of arrival at the warehouse",
"确认到仓?": "Confirmed to warehouse?",
"存在未到港或未清关的订单": "There are orders that have not arrived at the port or have not been cleared through customs",
"请先完成到港操作": "Please complete the arrival operation first",
"空运-分拣": "Air freight - sorting",
"到仓反审": "Reverse review upon arrival at the warehouse",
"确定移除货物吗?": "Are you sure to remove the goods?",
"空运订单重量上限": "Air freight order weight limit",
"空运清关费": "Air freight customs clearance fee",
"已发布,投放中": "Released, in the process of deployment",
"取消投放": "Cancel placement",
"投放": "Advertising",
"1天内过期": "Expires within 1 day",
"还有{days}天到期": "Due in {days} days",
"请选择客户经理。": "Please select an account manager.",
"回收客户": "Recycling customers",
"是否要回收当前{name}": "Do you want to recycle the current {name}",
"回收成功。": "Recycling successful.",
"已完成目标值": "Target value completed",
"请输入目标单位": "Please enter the target unit",
"新客户:": "New customers:",
"旧客户:": "Old customers:",
"清关费未报价": "Unquoted customs clearance fee",
"原泡重": "Original foam weight",
"新泡重": "New foam weight",
"用途": "purpose",
"混箱": "Mixed box",
"打包前入仓影像": "Pre packaging warehouse image",
"打包后入仓影像": "Packaging and warehousing images",
"暂无影像": "No images available at the moment",
"提单是否显示价格": "Does the bill of lading display the price",
"核销比例": "Verification ratio",
"是指由发货人与收货人约定在货物的国际运输过程中,我司作为第三方对该货物货权的控制;需由发货人授权我司放货的情况下收货人才能提取该票货物的一种交易方式": "It refers to the agreement between the shipper and the consignee that our company, as a third party, controls the ownership of the goods during international transportation; A transaction method in which the consignee can only retrieve the goods on the bill of lading if the shipper authorizes our company to release the goods",
"我司全代 : 该货物的出口手续由我司代为办理 ; 自单代报: 该货物由发货人提供相关出口单证并委托我司代为办理 ;混单代报该货物有以上两种情况出现": "Our company will handle the export procedures for the goods on our behalf; Self declaration: The shipper shall provide relevant export documents for the goods and entrust our company to handle them on their behalf; There are two situations where the goods are mixed and reported on behalf of others",
"如需我司打包,请勾选相应选项,费用付款人及打包要求可备注补充": "If you need our company to package, please check the corresponding option. The payer and packaging requirements can be noted and supplemented",
"不可出": "Unable to leave",
"确定设置订单{orderNo}不可出么?": "Are you sure you want to set the order {orderNo} not to be issued?",
"预计运费/清关费": "Estimated freight/customs clearance fee",
"处理备注": "Processing remarks",
"详细说明": "elaborate on",
"注意:收款后无法修改备货信息,请先联系仓库确认订单备货完成": "Attention: After receiving payment, the stocking information cannot be modified. Please contact the warehouse first to confirm that the order stocking is completed",
"货值三分之一占运费和清关费总和比例": "The proportion of one-third of the value of goods to the total freight and customs clearance fees",
"渠道包装超限品名列表": "List of Channel Packaging Overlimit Product Names",
"重量超限改价审核中": "Weight exceeding limit and price change review in progress",
"取消重量超限改价审核": "Cancel weight limit and price change review",
"请输入空运订单上限": "Please enter the upper limit for air freight orders",
"请先去设置运费或清关费本身的货币单位、计价单位": "Please first set the currency unit and pricing unit for the shipping or customs clearance fees themselves",
"选择订单商品": "Select order items",
"添加新商品": "Add new product",
"影像": "image",
"请确认货物打包完成再并箱": "Please confirm that the goods have been packed and then combined into boxes",
"并箱": "Combined box",
"并箱后不可恢复,是否确认并箱?": "After merging, it cannot be restored. Are you sure to merge?",
"新建订单成功": "New order successfully created",
"您的订舱号": "Your booking number",
"复制订单信息": "Copy order information",
"复制成功": "Copy successful",
"复制失败": "copy failed",
"此阶梯未设置阶梯和价格,将会被忽略": "This ladder has no ladder or price set and will be ignored",
"此阶梯价信息设置不完整": "This tiered pricing information setting is incomplete",
"第{steps}阶梯设置不完整": "The {steps} step setting is incomplete",
"已选择{route}条路线,{product}个商品;确认提交修改?": "{route} selected, {product} products; Confirm submitting modifications?",
"是否含阶梯价": "Does it include tiered pricing",
"*针对所有价格减价": "*Reduce prices for all items",
"商品清关费价格": "Price of customs clearance fee for goods",
"未设置清关费": "No customs clearance fee set",
"已选择{route}条路线,确认提交?": "{route} has been selected, confirm submission?",
"缺少阶梯价格设置": "Lack of tiered pricing settings",
"单询": "Single inquiry",
"复制模板": "Copy Template",
"取消单询": "Cancel single inquiry",
"单询异常": "Single inquiry exception",
"海运订单国家代码-海运订单城市代码-空运订单国家代码-空运自编号国家代码,没有可填0-": "Sea freight order country code - Sea freight order city code - Air freight order country code - Air freight self number country code, no 0 can be filled in-",
"海运目的国家简称-海运目的城市简称-空运订单编号目的国家简称-空运自编号目的国简称,\\n注意:如果没有海运业务的城市设置,请将海运目的国家简称-海运目的城市简称设置为->0-0,前置的参数不能为空": "Shipping Destination Country Abbreviation - Shipping Destination City Abbreviation - Air Transport Order Number Destination Country Abbreviation - Air Transport Self numbered Destination Country Abbreviation. \\ n Note: If there is no city setting for shipping business, please set the Shipping Destination Country Abbreviation - Shipping Destination City Abbreviation to ->0-0, and the preceding parameters cannot be empty",
"空运发件人": "Airfreight sender",
"空运发件人英文": "Air freight sender in English",
"空运发件公司地址": "Air freight shipping company address",
"空运发件公司地址英文": "Air freight shipping company address in English",
"空运收货人": "Air freight consignee",
"空运收货人英文": "Air freight consignee in English",
"空运收货地址": "Air freight delivery address",
"空运收货地址英文": "Air freight delivery address in English",
"代码不能为空": "Code cannot be empty",
"保函证书": "Letter of Guarantee Certificate",
"公司信息": "Company Information",
"会员编号": "Member ID",
"会员昵称": "Member nickname",
"绑定邮箱": "Bind email",
"生日": "birthday",
"上次登录": "Last login",
"档口": "Gear opening",
"公司简介": "Company Introduction",
"认证信息": "Certification information",
"企业": "enterprise",
"身份证认证状态": "Identity card authentication status",
"角标字段": "Subscript field",
"不清楚请留空,已设勿改": "Unclear, please leave blank. It has been set to remain unchanged",
"出仓纠错": "Out of warehouse correction",
"批量出仓纠错": "Batch outbound error correction",
"未出仓": "Not yet out of warehouse",
"出仓纠错(二维码/条形码编号)": "Out of warehouse correction (QR code/barcode number)",
"开始出仓": "Start warehouse release",
"装箱纠错": "Packing error correction",
"批量装箱纠错": "Batch packing error correction",
"计划/已装": "Planned/Installed",
"计划/已理": "Planned/Planned",
"已理": "Reasonable",
"未理": "Unreasoned",
"理货纠错(二维码/条形码编号)": "Correction of tally errors (QR code/barcode number)",
"仍有订单未理货,请完成所有订单箱号标签扫码后完成理货": "There are still orders that have not been tally. Please scan all order box number labels and complete the tally",
"所属目的国家": "Destination country",
" ": "",
"区间设置不完整,将被忽略": "Incomplete interval settings will be ignored",
"{n}个全包阶梯价": "{n} All inclusive tiered pricing",
"{n}个运费阶梯价": "{n} Shipping cost tiered pricing",
"{n}个清关费阶梯价": "{n} Staircase price for individual customs clearance fees",
"已选择{route}条路线,{product}个商品": "{route} selected, {product} products",
";确认提交修改?": "; Confirm submitting modifications?",
"空运{type}设置": "Air freight {type} settings",
"未选择包装类型将被忽略": "No packaging type selected will be ignored",
"请输入加价金额": "Please enter the markup amount",
"运费快捷加价": "Quick freight markup",
"提交运费": "Submit shipping fee",
"清关费快捷加价": "Quick increase in customs clearance fees",
"提交清关费": "Submit customs clearance fee",
"全包价快捷加价": "Quick and all inclusive price increase",
"提交全包价": "Submit full package price",
"第{no}阶段": "Stage {no}",
"线路重量上限": "Upper limit of line weight",
"包含": "contain",
"不包含": "Excluding",
"等于": "equal to",
"运费+清关费": "Freight+customs clearance fee",
"未设置全包价阶梯价": "No fully inclusive tiered pricing has been set",
"未设置运费阶梯价": "No freight tiered pricing has been set",
"渠道包装清关费": "Channel packaging customs clearance fee",
"所属国家": "Country",
"请输入所属国家": "Please enter your country of origin",
"包装加价": "Packaging markup",
"海运运费价格设置": "Ocean freight price setting",
"海运清关费价格设置": "Price setting for sea freight customs clearance fees",
"请设置{priceName}第{index}阶段的起始值": "Please set the starting value for the {index} stage of {priceName}",
"请设置{priceName}第{index}阶段的结束值": "Please set the end value for the {index} stage of {priceName}",
"请设置第{index}阶段的{priceName}": "Please set the {priceName} for the {index} stage",
"请设置第{index}阶段的包装类型{i}的{priceName}": "Please set the {priceName} for the packaging type {i} in the {index} stage"
}
\ No newline at end of file
...@@ -4,19 +4,22 @@ ...@@ -4,19 +4,22 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('名称')" prop="nameZh"> <el-form-item :label="$t('名称')" prop="nameZh">
<el-input v-model="queryParams.nameZh" :placeholder="$t('请输入名称')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.nameZh" :placeholder="$t('请输入名称')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="名称-英文" prop="nameEn"> <!-- <el-form-item label="名称-英文" prop="nameEn">
<el-input v-model="queryParams.nameEn" placeholder="请输入名称-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.nameEn" placeholder="请输入名称-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('内部名称')" prop="internalNameZh"> <el-form-item :label="$t('内部名称')" prop="internalNameZh">
<el-input v-model="queryParams.internalNameZh" :placeholder="$t('请输入内部名称')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.internalNameZh" :placeholder="$t('请输入内部名称')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="内部名称-英文" prop="internalNameEn"> <!-- <el-form-item label="内部名称-英文" prop="internalNameEn">
<el-input v-model="queryParams.internalNameEn" placeholder="请输入内部名称-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.internalNameEn" placeholder="请输入内部名称-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('类型编码')" prop="typeNumber"> <el-form-item :label="$t('类型编码')" prop="typeNumber">
<el-input v-model="queryParams.typeNumber" :placeholder="$t('请输入类型编码')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.typeNumber" :placeholder="$t('请输入类型编码')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="仓库ID字符串" prop="warehouseIds"> <!-- <el-form-item label="仓库ID字符串" prop="warehouseIds">
<el-input v-model="queryParams.warehouseIds" placeholder="请输入仓库ID字符串" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.warehouseIds" placeholder="请输入仓库ID字符串" clearable @keyup.enter.native="handleQuery"/>
...@@ -24,17 +27,24 @@ ...@@ -24,17 +27,24 @@
<!-- <el-form-item :label="$t('排序')" prop="sort"> <!-- <el-form-item :label="$t('排序')" prop="sort">
<el-input v-model="queryParams.sort" :placeholder="$t('请输入排序')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.sort" :placeholder="$t('请输入排序')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('快递ID')" prop="expressId"> <el-form-item :label="$t('所属国家')" prop="countryId">
<el-input v-model="queryParams.expressId" :placeholder="$t('请输入快递ID')" clearable @keyup.enter.native="handleQuery"/> <el-select filterable clearable v-model="queryParams.countryId" :placeholder="$t('请选择国家')">
<el-option v-for="dict in countryList"
:key="dict.id" :label="$l(dict,'title')" :value="parseInt(dict.id)"/>
</el-select>
<!-- <el-input v-model="queryParams.countryId" :placeholder="$t('请输入所属国家')" clearable @keyup.enter.native="handleQuery"/>-->
</el-form-item> </el-form-item>
<el-form-item :label="$t('预计时间')"> <el-form-item :label="$t('预计时间')">
<el-input v-model="queryParams.etaTime" :placeholder="$t('预计到达天数')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.etaTime" :placeholder="$t('预计到达天数')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('渠道代理')" prop="channelAgent"> <el-form-item :label="$t('渠道代理')" prop="channelAgent">
<el-input v-model="queryParams.channelAgent" :placeholder="$t('请输入渠道代理')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.channelAgent" :placeholder="$t('请输入渠道代理')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('备注')" prop="remarksZh"> <el-form-item :label="$t('备注')" prop="remarksZh">
<el-input v-model="queryParams.remarksZh" :placeholder="$t('请输入备注-中文')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.remarksZh" :placeholder="$t('请输入备注-中文')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="备注-英文" prop="remarksEn"> <!-- <el-form-item label="备注-英文" prop="remarksEn">
<el-input v-model="queryParams.remarksEn" placeholder="请输入备注-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.remarksEn" placeholder="请输入备注-英文" clearable @keyup.enter.native="handleQuery"/>
...@@ -58,47 +68,54 @@ ...@@ -58,47 +68,54 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:channel:create']">{{ $t('新增') }}</el-button> v-hasPermi="['ecw:channel:create']">{{ $t('新增') }}
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['ecw:channel:export']">{{ $t('导出') }}</el-button> :loading="exportLoading"
v-hasPermi="['ecw:channel:export']">{{ $t('导出') }}
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column :label="$t('渠道ID')" align="center" prop="channelId" /> <el-table-column :label="$t('渠道ID')" align="center" prop="channelId"/>
<el-table-column :label="$t('名称')" align="center" prop="nameZh"> <el-table-column :label="$t('名称')" align="center" prop="nameZh">
<template slot-scope="{row}">{{$l(row, 'name')}}</template> <template slot-scope="{row}">{{ $l(row, 'name') }}</template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="名称-英文" align="center" prop="nameEn" /> --> <!-- <el-table-column label="名称-英文" align="center" prop="nameEn" /> -->
<el-table-column :label="$t('内部名称')" align="center" prop="internalNameZh"> <el-table-column :label="$t('内部名称')" align="center" prop="internalNameZh">
<template slot-scope="{row}">{{$l(row, 'internalName')}}</template> <template slot-scope="{row}">{{ $l(row, 'internalName') }}</template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="内部名称-英文" align="center" prop="internalNameEn" /> <!-- <el-table-column label="内部名称-英文" align="center" prop="internalNameEn" />
<el-table-column :label="$t('类型编码')" align="center" prop="typeNumber" />--> <el-table-column :label="$t('类型编码')" align="center" prop="typeNumber" />-->
<!-- <el-table-column label="仓库id字符串" align="center" prop="warehouseIds" /> --> <!-- <el-table-column label="仓库id字符串" align="center" prop="warehouseIds" /> -->
<!-- <el-table-column :label="$t('仓库名')" align="center" prop="warehouseNameList" width="180">--> <!-- <el-table-column :label="$t('仓库名')" align="center" prop="warehouseNameList" width="180">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-scrollbar style="margin-right: 6px;">--> <!-- <el-scrollbar style="margin-right: 6px;">-->
<!-- <div class="left">--> <!-- <div class="left">-->
<!-- <el-tag v-for="warehouseName in scope.row.warehouseNameList"--> <!-- <el-tag v-for="warehouseName in scope.row.warehouseNameList"-->
<!-- :key="warehouseName.index">--> <!-- :key="warehouseName.index">-->
<!-- <span>{{warehouseName}}</span>--> <!-- <span>{{warehouseName}}</span>-->
<!-- </el-tag>--> <!-- </el-tag>-->
<!-- </div>--> <!-- </div>-->
<!-- </el-scrollbar>--> <!-- </el-scrollbar>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column :label="$t('简码')" align="center" prop="code" /> <el-table-column :label="$t('简码')" align="center" prop="code"/>
<el-table-column :label="$t('排序')" align="center" prop="sort" /> <el-table-column :label="$t('排序')" align="center" prop="sort"/>
<el-table-column :label="$t('快递公司')" align="center" prop="companyName" /> <el-table-column :label="$t('快递公司')" align="center" prop="companyName"/>
<el-table-column :label="$t('预计时间(天)')" align="center" prop="etaTime" /> <el-table-column :label="$t('预计时间(天)')" align="center" prop="etaTime"/>
<el-table-column :label="$t('渠道代理')" align="center" prop="channelAgent" /> <el-table-column :label="$t('所属国家')">
<el-table-column :label="$t('备注')" align="center" prop="remarksZh" /> <template slot-scope="{row}">
{{ $l(row, 'countryTitle') }}
</template>
</el-table-column>
<el-table-column :label="$t('备注')" align="center" prop="remarksZh"/>
<!-- <el-table-column label="备注-英文" align="center" prop="remarksEn" /> --> <!-- <el-table-column label="备注-英文" align="center" prop="remarksEn" /> -->
<!-- <el-table-column :label="$t('状态')" align="center" prop="status" /> --> <!-- <el-table-column :label="$t('状态')" align="center" prop="status" /> -->
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180"> <el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
...@@ -106,12 +123,22 @@ ...@@ -106,12 +123,22 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建人')" prop="creatorName"></el-table-column>
<el-table-column :label="$t('创建人')" prop="">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('跟新人')" prop="updaterName">
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:channel:update']">{{ $t('修改') }}</el-button> v-hasPermi="['ecw:channel:update']">{{ $t('修改') }}
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:channel:delete']">{{ $t('删除') }}</el-button> v-hasPermi="['ecw:channel:delete']">{{ $t('删除') }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -123,12 +150,20 @@ ...@@ -123,12 +150,20 @@
</template> </template>
<script> <script>
import { createChannel, updateChannel, deleteChannel, getChannel, getChannelPage, exportChannelExcel } from "@/api/ecw/channel"; import {
createChannel,
updateChannel,
deleteChannel,
getChannel,
getChannelPage,
exportChannelExcel
} from "@/api/ecw/channel";
import {getCountryListAll} from "@/api/ecw/country";
import {getTradeCountryList} from "@/api/ecw/region";
export default { export default {
name: "EcwChannelIndex", name: "EcwChannelIndex",
components: { components: {},
},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -155,18 +190,21 @@ export default { ...@@ -155,18 +190,21 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
countryList: [],
}
}; };
}, },
created() { created() {
getTradeCountryList().then(r => {
this.countryList = r.data
})
this.getList(); this.getList();
}, },
activated() { activated() {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -204,12 +242,13 @@ export default { ...@@ -204,12 +242,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const channelId = row.channelId; const channelId = row.channelId;
this.$modal.confirm(this.$t('是否确认删除渠道管理编号为{channelId}的数据项?',{channelId})).then(function() { this.$modal.confirm(this.$t('是否确认删除渠道管理编号为{channelId}的数据项?', {channelId})).then(function () {
return deleteChannel(channelId); return deleteChannel(channelId);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
...@@ -221,12 +260,13 @@ export default { ...@@ -221,12 +260,13 @@ export default {
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出 // 执行导出
this.$modal.confirm('是否确认导出所有渠道管理数据项?').then(() => { this.$modal.confirm('是否确认导出所有渠道管理数据项?').then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportChannelExcel(params); return exportChannelExcel(params);
}).then(response => { }).then(response => {
this.$download.excel(response, '渠道列表.xls'); this.$download.excel(response, '渠道列表.xls');
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {
});
} }
} }
}; };
...@@ -234,23 +274,23 @@ export default { ...@@ -234,23 +274,23 @@ export default {
<style lang="scss"> <style lang="scss">
.left { .left {
.el-tag { .el-tag {
background-color: #e6f6fd; background-color: #e6f6fd;
border: 1px solid #ccecfb; border: 1px solid #ccecfb;
display: inline-block; display: inline-block;
height:auto; height: auto;
padding: 0 10px; padding: 0 10px;
line-height: 30px; line-height: 30px;
font-size: 12px; font-size: 12px;
color: #02a1e9; color: #02a1e9;
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
white-space: nowrap; white-space: nowrap;
} }
} }
</style> </style>
...@@ -485,10 +485,10 @@ ...@@ -485,10 +485,10 @@
// 执行导出 // 执行导出
this.exportLoading = true; this.exportLoading = true;
exportDetailExcel(params).then(response => { exportDetailExcel(params).then(response => {
this.$download.excel(response, `${this.$t('业绩明细')}.xls`); // this.$download.excel(response, `${this.$t('业绩明细')}.xls`);
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
this.exportLoading = false; }).finally(() => {
}).catch(() => { this.exportLoading = false;
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
......
...@@ -756,6 +756,10 @@ export default { ...@@ -756,6 +756,10 @@ export default {
if(row['discountFreightPrice'] && row['discountFreightPrice'] > 0){ if(row['discountFreightPrice'] && row['discountFreightPrice'] > 0){
freightFields.push({field: 'afterDiscountSeaFreight', label: this.$t('优惠后单价')}) 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('成交单价')}) freightFields.push({field: 'oneSeaFreight', label: this.$t('成交单价')})
console.log({freightFields}) console.log({freightFields})
freightFields.forEach(item => { freightFields.forEach(item => {
...@@ -790,6 +794,10 @@ export default { ...@@ -790,6 +794,10 @@ export default {
if(row['discountClearanceFeePrice'] && row['discountClearanceFeePrice'] > 0){ if(row['discountClearanceFeePrice'] && row['discountClearanceFeePrice'] > 0){
clearanceFields.push({field: 'afterDiscountClearanceFreight', label: this.$t('优惠后单价')}) 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.push({field: 'oneClearanceFreight', label: this.$t('成交单价')})
clearanceFields.forEach(item => { clearanceFields.forEach(item => {
if(row[item.field]){ if(row[item.field]){
......
...@@ -896,13 +896,20 @@ export default { ...@@ -896,13 +896,20 @@ export default {
} }
}, },
// 目的地 // 目的地
'form.objectiveId'(objectiveId, oldObjectiveId){ async 'form.objectiveId'(objectiveId, oldObjectiveId){
this.getOpenedRouterList() // 重新获取路线
// 修改目的地后需要重新选择路线 await this.getOpenedRouterList()
if(oldObjectiveId && oldObjectiveId != objectiveId && !this.initing){ // 如果已选择的路线不在可用路线里则重置
console.log('修改目的地,重置lineId', oldObjectiveId, objectiveId) if(this.form.lineId && !this.routerList.find(item => item.id == this.form.lineId)){
this.$set(this.form, 'lineId', null) 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){ 'form.transportId'(transportId, oldTransportId){
// 空运 // 空运
...@@ -941,11 +948,19 @@ export default { ...@@ -941,11 +948,19 @@ export default {
if(this.form.lineId) this.getOfferData() 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'(){ 'form.consigneeCountryCode'(){
...@@ -1093,7 +1108,7 @@ export default { ...@@ -1093,7 +1108,7 @@ export default {
}) })
this.productAttrList = (await getProductAttrList()).data this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data await this.getChannelList()
await this.getTradeCity() await this.getTradeCity()
this.currencyList = (await getCurrencyList()).data this.currencyList = (await getCurrencyList()).data
this.unitList = (await getUnitList()).data this.unitList = (await getUnitList()).data
...@@ -1125,6 +1140,12 @@ export default { ...@@ -1125,6 +1140,12 @@ export default {
} }
this.tradeCityList = (await getTradeCityList(query)).data this.tradeCityList = (await getTradeCityList(query)).data
}, },
async getChannelList(){
let query = {
cityId: this.form.objectiveId
}
this.channelList = (await getChannelList(query)).data
},
onTableMounted(e){ onTableMounted(e){
// console.warn('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 @@ ...@@ -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" /> <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) {
......
...@@ -491,9 +491,9 @@ export default { ...@@ -491,9 +491,9 @@ export default {
this.$message.success(this.$t('操作成功')) this.$message.success(this.$t('操作成功'))
}) })
}, },
// 退仓 // 并箱
async rollback(orderItem){ 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({ return rollbackDelete({
orderId: this.orderId, orderId: this.orderId,
orderItemId: orderItem.orderItemId, orderItemId: orderItem.orderItemId,
......
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="1024px" width="1024px"
:before-close="handleClose"> :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"> <el-form v-if="dialogVisible">
<WarehouseRecordDetailItem <WarehouseRecordDetailItem
...@@ -30,6 +37,12 @@ ...@@ -30,6 +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"
:warehouse-in-id="warehouseInId"
@close="showChooseDialog=false"
@success="handleChooseOrderProducts"></choose-order-products>
</div> </div>
</template> </template>
...@@ -37,13 +50,15 @@ ...@@ -37,13 +50,15 @@
import ProductSelector from "@/components/ProductSelector/index.vue"; import ProductSelector from "@/components/ProductSelector/index.vue";
import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue"; import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue";
import {getProductAttrList} from "@/api/ecw/productAttr"; import {getProductAttrList} from "@/api/ecw/productAttr";
import {getOrderItemCommonAttr} from "@/api/ecw/order";
import ChooseOrderProducts from "@/views/ecw/order/stocking/components/ChooseOrderProducts.vue";
/** /**
* 入仓明细弹窗 * 入仓明细弹窗
*/ */
export default { export default {
name: 'WarehouseRecordDetail', name: 'WarehouseRecordDetail',
components: {WarehouseRecordDetailItem, ProductSelector}, components: {ChooseOrderProducts, WarehouseRecordDetailItem, ProductSelector},
props: { props: {
value: { value: {
...@@ -61,7 +76,11 @@ export default { ...@@ -61,7 +76,11 @@ export default {
num:{ num:{
type:Number, type:Number,
default:0 default:0
} },
// 是否显示添加订单商品按钮
showChooseOrderItem:Boolean,
orderId: Number,
warehouseInId: Number
}, },
data() { data() {
...@@ -69,7 +88,8 @@ export default { ...@@ -69,7 +88,8 @@ export default {
dialogVisible: false, dialogVisible: false,
dataList: [], dataList: [],
// 特性列表 // 特性列表
attrList: [] attrList: [],
showChooseDialog: false
}; };
}, },
...@@ -158,6 +178,40 @@ export default { ...@@ -158,6 +178,40 @@ export default {
} }
this.$emit('input', this.dataList) this.$emit('input', this.dataList)
this.dialogVisible = false 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 { ...@@ -173,5 +227,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.title{
font-size: 16px;
}
</style> </style>
...@@ -153,16 +153,14 @@ export default { ...@@ -153,16 +153,14 @@ 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(',') || []
} }
...@@ -246,7 +244,23 @@ export default { ...@@ -246,7 +244,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>
......
...@@ -28,131 +28,81 @@ ...@@ -28,131 +28,81 @@
:label="$t('最小起计量')" :label="$t('最小起计量')"
:prop="`minWeight`" :prop="`minWeight`"
> >
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/> <el-input-number v-model="form.minWeight" class="w-100" :min="0" :controls="false"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled /> / <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" disabled />
</el-form-item>
<!--阶梯订单-->
<template v-if="form.stepPrice==1" >
<div v-for="(item, index) in form.priceStepList" :key="index">
<div style="font-size:14px; margin:10px 0">
{{$t('第{index}阶梯定价方案', {index: index+1})}}
<template v-if="index == form.priceStepList.length - 1">
<el-link type="primary" @click.native="form.priceStepList.push({})">{{$t('添加区间')}}</el-link>
<el-divider v-if="index" direction="vertical"></el-divider>
<el-link v-if="index" type="danger" @click.native="form.priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
</template>
</div>
<div v-if="willBeIgnore(item)" style="color:red">{{$t('此阶梯未设置阶梯和价格,将会被忽略')}}</div>
<div v-else-if="!isStepPriceOk(item)" style="color:red">{{$t('此阶梯价信息设置不完整')}}</div>
<el-form-item :label="$t(`第{index}阶梯`, {index: index+1})">
<el-input v-model="item.startNum" type="number" placeholder="" class="w100"></el-input>
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w100"></el-input>
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1" :key="`transportPrice-${index}`">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1 && type != 'air'">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1" :key="`allPrice-${index}`">
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
</div>
</template>
<!--非阶梯订单-->
<template v-else>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector v-model="form.allPriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector v-model="form.allVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<template v-else>
<el-form-item :label="$t('默认运费')" prop="transportPrice">
<selector v-model="form.transportPriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector v-model="form.transportVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" prop="clearancePrice" v-if="type != 'air'">
<selector v-model="form.clearancePriceUnit" @input="syncAllUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector v-model="form.clearanceVolumeUnit" @input="syncAllUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
</template>
<!--特需-->
<template v-if="form.priceType==1">
<el-form-item
v-for="(special, specialIndex) in form.specialList"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
:key="specialIndex + 'transport'">
<selector disabled v-model="special.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
<template v-else v-for="(special, specialIndex) in form.specialList">
<el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:key="specialIndex + 'transport'">
<selector disabled v-model="special.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item
v-if="type != 'air'"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
:key="specialIndex + 'clearance'">
<selector disabled v-model="special.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="special.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10 mr-10" />
/ <selector disabled v-model="special.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</template>
<!-- <el-form-item :label="$t('是否预付')" prop="advanceStatus">
<dict-selector form-type="radio" :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
</el-form-item> -->
<el-form-item :label="$t('价格有效期')">
<el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
-
<el-date-picker v-model="form.validateEndDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="form.stepPrice"> <el-col :span="12">
<h2>{{$t('快捷设置')}}</h2> <quick-set :unit-list="unitList" :currency-list="currencyList" :value="form"></quick-set>
<div class="flex items-center">
{{$t('批量加价')}}+
<el-input v-model="quickForm.plus" class="w-100 ml-10 mr-10" :disabled="!!quickForm.minus"></el-input>
<selector disabled v-model="currencyAndUnit.currency" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100" />
/ <selector disabled v-model="currencyAndUnit.unit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
<div class="ml-10">{{$t('*针对所有价格加价')}}</div>
</div>
<div class="flex items-center mt-10">
{{$t('批量减价')}} -
<el-input v-model="quickForm.minus" class="w-100 ml-10 mr-10" :disabled="!!quickForm.plus"></el-input>
<selector disabled v-model="currencyAndUnit.currency" :options="currencyList" :label-field="$l('title')" value-field="id" class="w-100" />
/ <selector disabled v-model="currencyAndUnit.unit" :options="unitList" :label-field="$l('title')" value-field="id" class="w-100" />
<div class="ml-10">{{$t('*针对所有价格加价')}}</div>
</div>
<div class="mt-10">
<el-button @click="quickSet" type="primary" :disabled="!quickForm.plus && !quickForm.minus">{{$t('确定')}}</el-button>
</div>
</el-col> </el-col>
</el-row> </el-row>
<template v-if="form.stepPrice">
<!--全包价-->
<template v-if="form.priceType==1" >
<div v-for="(item, index) in form.fullPriceStepList" :key="index">
<price-step
ref="stepPrice"
:index="index"
:currency-list="currencyList"
:unit-list="unitList"
field-prefix="all"
:price-name="$t('全包价')"
:show-add="index === form.fullPriceStepList.length -1"
:value="item"
@add="handleAddPrice('fullPriceStepList', $event)"
@delete="handleDeletePrice('fullPriceStepList', $event)"
@changeUnit="handleUnitChange(form.fullPriceStepList, index, ...$event)"
></price-step>
</div>
</template>
<el-row v-else :gutter="20" class="mt-20">
<el-col :span="12">
<div v-for="(item, index) in form.freightPriceStepList" :key="index">
<price-step
ref="stepPrice"
:index="index"
:currency-list="currencyList"
:unit-list="unitList"
field-prefix="transport"
:price-name="$t('运费')"
:show-add="index === form.freightPriceStepList.length -1"
:value="item"
@add="handleAddPrice('freightPriceStepList', $event)"
@delete="handleDeletePrice('freightPriceStepList', $event)"
@changeUnit="handleUnitChange(form.freightPriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
<el-col :span="12">
<div v-for="(item, index) in form.clearancePriceStepList" :key="index">
<price-step
ref="stepPrice"
:index="index"
:currency-list="currencyList"
:unit-list="unitList"
field-prefix="clearance"
:price-name="$t('清关费')"
:show-add="index === form.clearancePriceStepList.length -1"
:value="item"
@add="handleAddPrice('clearancePriceStepList', $event)"
@delete="handleDeletePrice('clearancePriceStepList', $event)"
@changeUnit="handleUnitChange(form.clearancePriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
</el-row>
</template>
<template v-else>
<sea-price
ref="seaPrice"
:price-type="form.priceType"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
</el-card> </el-card>
...@@ -203,9 +153,17 @@ import Selector from '@/components/Selector' ...@@ -203,9 +153,17 @@ import Selector from '@/components/Selector'
import Inputor from '@/components/Inputor' import Inputor from '@/components/Inputor'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import {getProduct} from "@/api/ecw/product"; import {getProduct} from "@/api/ecw/product";
import QuickSet from "@/views/ecw/productPrice/components/QuickSet.vue";
import PriceStep from "@/views/ecw/productPrice/components/PriceStep.vue";
import SeaPrice from "@/views/ecw/productPrice/components/SeaPrice.vue";
import Template from "@/views/cms/template/index.vue";
const DEFAULT_PRICE_UNIT = 1
const DEFAULT_VOLUME_UNIT = 7
const DEFAULT_WEIGHT_UNIT = 7
export default { export default {
components: { RoutersSelector, ProductsSelector, Selector, Inputor }, components: {Template, SeaPrice, PriceStep, QuickSet, RoutersSelector, ProductsSelector, Selector, Inputor },
data() { data() {
return { return {
checkList: [], checkList: [],
...@@ -214,7 +172,11 @@ export default { ...@@ -214,7 +172,11 @@ export default {
specialList: [], specialList: [],
priceStepList: [], priceStepList: [],
stepPrice: 0, stepPrice: 0,
priceType: null priceType: null,
minWeightUnit: null,
allVolumeUnit: DEFAULT_VOLUME_UNIT,
transportVolumeUnit: DEFAULT_VOLUME_UNIT,
clearanceVolumeUnit: DEFAULT_VOLUME_UNIT,
// advanceStatus: 0, // advanceStatus: 0,
// needBook: 0, // needBook: 0,
// dayLimit: 10000 // dayLimit: 10000
...@@ -266,42 +228,6 @@ export default { ...@@ -266,42 +228,6 @@ export default {
return !content && content !== 0 && content !== '0' return !content && content !== 0 && content !== '0'
} }
}, },
// 判断某个阶梯价是否会被忽略
willBeIgnore(){
return (stepPrice) => {
if(!this.isEmpty(stepPrice.startNum) || !this.isEmpty(stepPrice.endNum)) return false
if(this.form.priceType == 1 && !this.isEmpty(stepPrice.allPrice)) return false
if(this.form.priceType != 1 && !this.isEmpty(stepPrice.transportPrice) && !this.isEmpty(stepPrice.clearancePrice)) return false
return true
}
},
// 判断阶梯价是否设置不完整
isStepPriceOk(){
return (stepPrice) => {
console.log({
stepPrice,
startNum: this.isEmpty(stepPrice.startNum),
endNum:this.isEmpty(stepPrice.endNum),
allPrice: this.isEmpty(stepPrice.allPrice),
allPriceUnit: this.isEmpty(stepPrice.allPriceUnit),
allVolumeUnit: this.isEmpty(stepPrice.allVolumeUnit),
transportPrice: this.isEmpty(stepPrice.transportPrice),
transportPriceUnit: this.isEmpty(stepPrice.transportPriceUnit),
transportVolumeUnit: this.isEmpty(stepPrice.transportVolumeUnit),
priceType: this.form.priceType
})
if(this.isEmpty(stepPrice.startNum) || this.isEmpty(stepPrice.endNum)) return false
if(this.form.priceType == 1 && (this.isEmpty(stepPrice.allPrice) || this.isEmpty(stepPrice.allPriceUnit) || this.isEmpty(stepPrice.allVolumeUnit))){
console.log('全包价设置不完整')
return false
}
else if(this.form.priceType != 1 && (this.isEmpty(stepPrice.transportPrice) || this.isEmpty(stepPrice.transportPriceUnit) || this.isEmpty(stepPrice.transportVolumeUnit))){ // 清关费可能为0或者空
console.log('非全报价,未设置完整')
return false
}
return true
}
},
}, },
watch: { watch: {
checkList() { //选择路线 checkList() { //选择路线
...@@ -317,24 +243,16 @@ export default { ...@@ -317,24 +243,16 @@ export default {
this.$set(this.form, 'productType', this.product.typeId) this.$set(this.form, 'productType', this.product.typeId)
}, },
'form.stepPrice'(stepPrice){ 'form.stepPrice'(stepPrice){
if(stepPrice == 1 && !this.form.priceStepList.length){ if(this.form.stepPrice === 1){
this.form.priceStepList = [{}, {}] this.initStepPrice()
} }
this.syncMinWeightUnit()
}, },
selectedRoutes(routers) { 'form.priceType'(priceType){
let transportIds = [] if(this.form.stepPrice === 1){
routers.forEach(item => { this.initStepPrice()
item.shippingChannelId = item.channelId }
transportIds.push(+item.transportId) this.syncMinWeightUnit()
})
// 如果只选择了空运(3),则默认体积单位改成千克
transportIds = new Set(transportIds)
console.log(transportIds)
window.transportIds = transportIds
if(transportIds.size == 1 && transportIds.has(3)){
this.setDefaultVolumeUnit(6)
}else this.setDefaultVolumeUnit(7)
}, },
'form.needBook'(val){ 'form.needBook'(val){
if(val) this.$set(this.form, 'dayLimit', 10000) if(val) this.$set(this.form, 'dayLimit', 10000)
...@@ -342,17 +260,10 @@ export default { ...@@ -342,17 +260,10 @@ export default {
}, },
}, },
async created() { async created() {
getCurrencyList().then(res => this.currencyList = res.data) this.currencyList = (await getCurrencyList())?.data || []
getUnitList().then(res => this.unitList = res.data) this.unitList = (await getUnitList())?.data || []
await this.$nextTick() await this.$nextTick()
// 如果是空运,阶梯价格默认为1
if(this.type == 'air'){
this.$set(this.form, 'stepPrice', 1)
}
// 默认单位,空运千克,海运立方米
this.setDefaultVolumeUnit(this.type == 'air' ? 6 : 7)
// 如果是复制,则获取数据并填充,先复制,然后填充特需,避免数据的特需不全导致部分不显示 // 如果是复制,则获取数据并填充,先复制,然后填充特需,避免数据的特需不全导致部分不显示
if(this.$route.query.templateId){ if(this.$route.query.templateId){
...@@ -360,19 +271,18 @@ export default { ...@@ -360,19 +271,18 @@ export default {
} }
// 从价格中获取特需的默认单位 // 从价格中获取特需的默认单位
const obj = (this.form.stepPrice ? this.form.priceStepList[0] : this.form) || {}
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => { this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
// 没有的才push,已有的可能是从复制模板携带过来的数据 // 没有的才push,已有的可能是从复制模板携带过来的数据
if(!this.form.specialList.find(special => special.specialDictType == item.value)) { if(!this.form.specialList.find(special => special.specialDictType == item.value)) {
console.log('特需push', item.value) console.log('特需push', item.value)
this.form.specialList.push({ this.form.specialList.push({
"clearancePrice": null, "clearancePrice": null,
"clearancePriceUnit": obj.clearancePriceUnit, "clearancePriceUnit": DEFAULT_PRICE_UNIT,
"clearanceVolumeUnit": obj.clearanceVolumeUnit, "clearanceVolumeUnit": DEFAULT_VOLUME_UNIT,
"specialDictType": item.value, "specialDictType": item.value,
"transportPrice": null, "transportPrice": null,
"transportPriceUnit": obj.transportPriceUnit, "transportPriceUnit": DEFAULT_PRICE_UNIT,
"transportVolumeUnit": obj.transportVolumeUnit, "transportVolumeUnit": DEFAULT_VOLUME_UNIT,
}) })
}else console.log('已存在特需', item.value) }else console.log('已存在特需', item.value)
}) })
...@@ -453,76 +363,116 @@ export default { ...@@ -453,76 +363,116 @@ export default {
this.$refs.productSelector.choose(res.data) this.$refs.productSelector.choose(res.data)
})*/ })*/
}, },
// 同步全部单位 // 设置最小起计量单位
syncAllUnit(){ syncMinWeightUnit(){
let obj = this.form.stepPrice == 1 ? this.form.priceStepList[0] : this.form // 如果是阶梯价
let fields = {} if(this.form.stepPrice){
// 全包价 const field = this.form.priceType === 1 ? "fullPriceStepList" : "freightPriceStepList"
if(this.form.priceType == 1){ const stepPriceList = this.form[field]
fields = { if(stepPriceList?.length){
allPriceUnit: obj['allPriceUnit'], this.form.minWeightUnit = stepPriceList[0]?.weightUnit || DEFAULT_WEIGHT_UNIT
allVolumeUnit: obj['allVolumeUnit'] }else {
} this.form.minWeightUnit = DEFAULT_WEIGHT_UNIT
}else{ }
fields = { }else{
transportPriceUnit: obj.transportPriceUnit, this.form.minWeightUnit = this.form[this.form.priceType === 1 ? 'allVolumeUnit' : 'transportVolumeUnit'] || DEFAULT_WEIGHT_UNIT
transportVolumeUnit: obj.transportVolumeUnit,
clearancePriceUnit: obj.clearancePriceUnit,
clearanceVolumeUnit: obj.clearanceVolumeUnit,
} }
},
handleAddPrice(field, fieldPrefix){
if(!this.form[field]){
this.$set(this.form, field, [])
} }
let priceUnit = DEFAULT_PRICE_UNIT
// 全包价还需要同步阶梯的重量单位 let volumeUnit = DEFAULT_VOLUME_UNIT
if(this.form.stepPrice == 1){ let weightUnit = DEFAULT_WEIGHT_UNIT
fields['weightUnit'] = obj.weightUnit if(this.form[field].length){
const first = this.form[field][0]
priceUnit = first[`${fieldPrefix}PriceUnit`]
volumeUnit = first[`${fieldPrefix}VolumeUnit`]
weightUnit = first.weightUnit
} }
console.log("添加价格的默认单位", {
this.syncSpecialUnit(fields) priceUnit,
volumeUnit,
weightUnit
})
this.form[field].push({
[`${fieldPrefix}PriceUnit`]: priceUnit,
[`${fieldPrefix}VolumeUnit`]: volumeUnit,
weightUnit: weightUnit,
specialList:[]
})
},
handleDeletePrice(field, index){
this.form[field].splice(index, 1)
}, },
// 同步特需的货币单位和体积单位 handleUnitChange(stepPriceList, index, data){
syncSpecialUnit(obj){ console.log('handleUnitChange', ...arguments)
console.log('syncSpecialUnit', obj) if(index > 0) return
if(!obj) return
// 同步特需单位 // 如果是重量单位,且不是清关费想换的,则需要同步最小起计量单位
this.form.specialList.forEach(item => { if(data.field === 'weightUnit' && data.type != 'clearance'){
Object.assign(item, obj) this.form.minWeightUnit = data.value
}
stepPriceList.forEach(item => {
item[data.field] = data.value
if(item.packagingList?.length){
item.packagingList.forEach(p => {
if(data.field.indexOf("PriceUnit") > -1){
p['packagingPriceUnit'] = data.value
}
if(data.field.indexOf("VolumeUnit") > -1){
p['packagingVolumeUnit'] = data.value
}
})
}
if(item.specialList?.length){
item.specialList.forEach(p => {
p[data.field] = data.value
})
}
}) })
},
// 如果是阶梯价则需要同步其他阶梯 // 获得用语提交的阶梯价副本
if(this.form.stepPrice == 1){ getPriceList(stepList){
this.form.priceStepList.forEach((item, index) => { if(!stepList?.length) return []
this.$set(this.form.priceStepList, index, Object.assign(item, obj)) let stepPriceList = JSON.parse(JSON.stringify(stepList))
stepPriceList.forEach((item, index) => {
item.rankNum = index + 1
item.packagingList = item.packagingList.filter(p => !!p.packagingTypes?.length)
item.packagingList = item.packagingList.map( p => {
p.packagingTypes = p.packagingTypes.join(",")
return p
}) })
} })
return stepPriceList
},
// 非阶梯价格更新单位
handleFormUnitChange(data){
console.log("handleFormUnitChange", {...data})
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
// 不是阶梯价需要 同步最小起计量 if(this.form.specialList?.length){
if(obj['transportVolumeUnit'] || obj['allVolumeUnit']){ this.form.specialList.forEach(p => {
this.$set(this.form, 'minWeightUnit', obj['transportVolumeUnit'] || obj['allVolumeUnit']) p[data.field] = data.value
} })
}
}, },
// 价格校验器 initStepPrice(){
priceValidator(rule, value, callback){ if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
if(!value || value == '') return callback() this.handleAddPrice("fullPriceStepList", 'all')
value = parseFloat(value)
if(!value || value < 0){
return callback(new Error('价格错误'))
} }
callback() if(this.form.priceType === 0){
}, if(!this.form.freightPriceStepList?.length){
setDefaultVolumeUnit(unit){ this.handleAddPrice('freightPriceStepList', 'transport')
this.$set(this.form, 'transportVolumeUnit', unit) }
this.$set(this.form, 'clearanceVolumeUnit', unit) if(!this.form.clearancePriceStepList?.length){
this.$set(this.form, 'allVolumeUnit', unit) this.handleAddPrice('clearancePriceStepList', 'clearance')
this.$set(this.form, 'minWeightUnit', unit) }
console.log(this.form.priceStepList, this.form.stepPrice)
// 阶梯价
if(this.form.stepPrice == 1 && this.form.priceStepList?.length){
this.form.priceStepList.forEach(item => {
this.$set(item, 'transportVolumeUnit', unit)
this.$set(item, 'clearanceVolumeUnit', unit)
this.$set(item, 'allVolumeUnit', unit)
this.$set(item, 'weightUnit', unit)
})
} }
}, },
submitForm() { submitForm() {
...@@ -550,33 +500,28 @@ export default { ...@@ -550,33 +500,28 @@ export default {
if(!data.isAllProduct && (!data.productIdList || !data.productIdList.length)){ if(!data.isAllProduct && (!data.productIdList || !data.productIdList.length)){
return this.$message.error('请选择商品') return this.$message.error('请选择商品')
} }
/* if(this.form.stepPrice == 1){
data.priceStepList = this.form.priceStepList
} */
// 没有设置阶梯价格则不提交priceStepList
if(data.stepPrice != 1){
delete data.priceStepList
}else{
// 根据23-11-23 21点左右的群讨论,阶梯价如果留空则不提交,如果全部为空则不提交此字段
// 相关工单 https://zentao.test.jdshangmen.com/bug-view-5460.html
// 填写不完整的给提示 // 阶梯价校验
let notOk = [] if(this.$refs.stepPrice){
data.priceStepList.forEach((item, index) => { let isValid = true
if(!this.willBeIgnore(item) && !this.isStepPriceOk(item)){ for (let stepPrice of this.$refs.stepPrice){
notOk.push(index + 1) if(!stepPrice.validate()){
isValid = false
break
}
} }
}) if(!isValid)return
if(notOk.length){ }
return this.$confirm(this.$t("第{steps}阶梯设置不完整", {steps: notOk.join(",")}))
} // 全包价
// 删除未填写的阶梯价 if(this.form.priceType == 1) {
data.priceStepList = data.priceStepList.filter(item => { data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList)
return !this.willBeIgnore(item) delete data.clearancePriceStepList
}) delete data.freightPriceStepList
if(!data.priceStepList.length){ }else{
delete data.priceStepList data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList)
} data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList)
delete data.fullPriceStepList
} }
data.lineChannelList = this.selectedRoutes data.lineChannelList = this.selectedRoutes
......
...@@ -102,21 +102,34 @@ export default { ...@@ -102,21 +102,34 @@ export default {
const index = this.index const index = this.index
const errors = [] const errors = []
// 区间设置检查 // 区间设置检查
if(index > 0 && !this.value.startNum){ if(typeof this.value.startNum != "number"){
errors.push(`请设置${this.priceName}${index+1}阶段的起始值`) errors.push(this.$t("请设置{priceName}第{index}阶段的起始值", {
index: index + 1,
priceName: this.priceName
}))
} }
if(!this.value.endNum){ 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`])){ 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){ if(this.value.packagingList?.length){
this.value.packagingList.forEach((item, i) => { this.value.packagingList.forEach((item, i) => {
if(item.packagingTypes?.length && !this.validatePrice(item.packagingPrice)){ 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
}))
} }
}) })
} }
......
...@@ -93,118 +93,133 @@ export default { ...@@ -93,118 +93,133 @@ export default {
</script> </script>
<template> <template>
<div> <el-row>
<el-form-item :label="$t('默认运费')" v-if="!priceType"> <el-col :span="12">
<el-input-number v-model="value[`transportPrice`]" :placeholder="$t('整数或者两位小数')" :controls="false":disabled="readonly" class="w-100 mr-10"/> <div class="page-title">{{$t('海运运费价格设置')}}</div>
<selector <el-form-item :label="$t('默认运费')" v-if="!priceType">
:disabled="readonly" <el-input-number v-model="value[`transportPrice`]" :placeholder="$t('整数或者两位小数')" :controls="false":disabled="readonly" class="w-100 mr-10"/>
v-model="value[`transportPriceUnit`]" <selector
:options="currencyList" :disabled="readonly"
:label-field="$l(null, 'title')" v-model="value[`transportPriceUnit`]"
@input="$emit('changeUnit', { :options="currencyList"
:label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event, value: $event,
field: `transportPriceUnit` field: `transportPriceUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
/ /
<selector <selector
:disabled="readonly" :disabled="readonly"
v-model="value[`transportVolumeUnit`]" v-model="value[`transportVolumeUnit`]"
:options="unitList" :options="unitList"
:label-field="$l(null, 'title')" :label-field="$l(null, 'title')"
@input="$emit('changeUnit', { @input="$emit('changeUnit', {
value: $event, value: $event,
field: `transportVolumeUnit` field: `transportVolumeUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="!priceType">
<el-input-number v-model="value[`clearancePrice`]" :placeholder="$t('整数或者两位小数')" :disabled="readonly" :controls="false" class="w-100 mr-10"/> <el-form-item :label="$t('默认全包价')" v-if="priceType">
<selector <el-input-number v-model="value[`allPrice`]" :placeholder="$t('整数或者两位小数')" :disabled="readonly" :controls="false" class="w-100 mr-10"/>
:disabled="readonly" <selector
v-model="value[`clearancePriceUnit`]" :disabled="readonly"
:options="currencyList" v-model="value[`allPriceUnit`]"
:label-field="$l(null, 'title')" :options="currencyList"
@input="$emit('changeUnit', { :label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event, value: $event,
field: `clearancePriceUnit` field: `allPriceUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
/ /
<selector <selector
:disabled="readonly" :disabled="readonly"
v-model="value[`clearanceVolumeUnit`]" v-model="value[`allVolumeUnit`]"
:options="unitList" :options="unitList"
:label-field="$l(null, 'title')" :label-field="$l(null, 'title')"
@input="$emit('changeUnit', { @input="$emit('changeUnit', {
value: $event, value: $event,
field: `clearanceVolumeUnit` field: `allVolumeUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="priceType"> <!--特性加价-->
<el-input-number v-model="value[`allPrice`]" :placeholder="$t('整数或者两位小数')" :disabled="readonly" :controls="false" class="w-100 mr-10"/> <template v-for="(special, specialIndex) in value.specialList">
<selector <div :key="specialIndex + 'transport'">
:disabled="readonly" <el-form-item
v-model="value[`allPriceUnit`]" v-if="!priceType"
:options="currencyList" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:label-field="$l(null, 'title')" >
@input="$emit('changeUnit', { <el-input-number v-model.number="special[`transportPrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`transportPriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector disabled v-model="special[`transportVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item
v-if="priceType"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
>
<el-input-number v-model.number="special[`allPrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`allPriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector disabled v-model="special[`allVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</div>
</template>
</el-col>
<el-col :span="12" v-if="!priceType">
<div class="page-title">{{$t('海运清关费价格设置')}}</div>
<el-form-item :label="$t('默认清关费')">
<el-input-number v-model="value[`clearancePrice`]" :placeholder="$t('整数或者两位小数')" :disabled="readonly" :controls="false" class="w-100 mr-10"/>
<selector
:disabled="readonly"
v-model="value[`clearancePriceUnit`]"
:options="currencyList"
:label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event, value: $event,
field: `allPriceUnit` field: `clearancePriceUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
/ /
<selector <selector
:disabled="readonly" :disabled="readonly"
v-model="value[`allVolumeUnit`]" v-model="value[`clearanceVolumeUnit`]"
:options="unitList" :options="unitList"
:label-field="$l(null, 'title')" :label-field="$l(null, 'title')"
@input="$emit('changeUnit', { @input="$emit('changeUnit', {
value: $event, value: $event,
field: `allVolumeUnit` field: `clearanceVolumeUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
</el-form-item> </el-form-item>
<!--特性加价--> <!--特性加价-->
<template v-for="(special, specialIndex) in value.specialList"> <template v-for="(special, specialIndex) in value.specialList">
<div :key="specialIndex + 'transport'"> <div :key="specialIndex + 'transport'">
<el-form-item
v-if="!priceType" <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')" v-if="!priceType"
> :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
<el-input-number v-model.number="special[`transportPrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> >
<selector disabled v-model="special[`transportPriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> <el-input-number v-model.number="special[`clearancePrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span> <selector disabled v-model="special[`clearancePriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<selector disabled v-model="special[`transportVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <span class="mr-10">/</span>
</el-form-item> <selector disabled v-model="special[`clearanceVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<el-form-item </el-form-item>
v-if="!priceType" </div>
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')" </template>
>
<el-input-number v-model.number="special[`clearancePrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`clearancePriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> </el-col>
<span class="mr-10">/</span> </el-row>
<selector disabled v-model="special[`clearanceVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
<el-form-item
v-if="priceType"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
>
<el-input-number v-model.number="special[`allPrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`allPriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector disabled v-model="special[`allVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item>
</div>
</template>
</div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -371,12 +371,14 @@ export default { ...@@ -371,12 +371,14 @@ export default {
if(this.form.stepPrice === 1){ if(this.form.stepPrice === 1){
this.initStepPrice() this.initStepPrice()
} }
this.syncMinWeightUnit()
}, },
'form.stepPrice'(stepPrice){ 'form.stepPrice'(stepPrice){
if(this.form.stepPrice === 1){ if(this.form.stepPrice === 1){
this.initStepPrice() this.initStepPrice()
} }
this.stepPrice = !!stepPrice this.stepPrice = !!stepPrice
this.syncMinWeightUnit()
}, },
needPay(val){ needPay(val){
this.$set(this.form, 'needPay', val ? 1 : 0) this.$set(this.form, 'needPay', val ? 1 : 0)
...@@ -521,6 +523,21 @@ export default { ...@@ -521,6 +523,21 @@ export default {
}) })
}, },
methods: { 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){ handleAddPrice(field, fieldPrefix){
if(!this.form[field]){ if(!this.form[field]){
this.$set(this.form, field, []) this.$set(this.form, field, [])
...@@ -593,11 +610,18 @@ export default { ...@@ -593,11 +610,18 @@ export default {
}, },
// 非阶梯价格更新单位 // 非阶梯价格更新单位
handleFormUnitChange(data){ handleFormUnitChange(data){
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
if(this.form.specialList?.length){ if(this.form.specialList?.length){
this.form.specialList.forEach(p => { this.form.specialList.forEach(p => {
p[data.field] = data.value p[data.field] = data.value
}) })
} }
// TODO 等加了包装之后还需要同步包装的单位
}, },
initStepPrice(){ initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){ 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