Commit c526dc21 authored by chenwei's avatar chenwei

【099】| Reward module change operation

parent fb74019d
import request from "@/utils/request";
//获取网点列表
export function getNodeList(query) {
return request({
url: "/ecw/node/list-all-simple",
method: "get",
params: query,
});
}
//获取积分列表
export function getGiftList(data) {
return request({
url: "/ecw/reward/page",
method: "post",
params: {
page: data.page,
rows: data.rows,
},
data: data,
});
}
//新增礼品
export function addRewards(data) {
return request({
url: "/ecw/reward/create",
method: "post",
data: data,
});
}
//删除礼品
export function deleteRewards(data) {
return request({
url: "/ecw/reward/delete?id=" + data.id,
method: "delete",
});
}
//礼品延期
export function delayRewards(data) {
return request({
url: "/ecw/reward/delay",
method: "post",
data: data,
});
}
//编辑礼品
export function editRewards(data) {
return request({
url: "/ecw/reward/update",
method: "post",
data: data,
});
}
//礼品状态变更
export function changeRewardsStatus(data) {
return request({
url: "/ecw/reward/status",
method: "post",
data: data,
});
}
//复制礼品
export function copyRewardsAPI(id) {
return request({
url: "/ecw/reward/copy/" + id,
method: "post",
});
}
//获取单个礼品详情
export function getRewardsDetails(data) {
return request({
url: "/ecw/reward/get",
method: "get",
params: data,
});
}
//获取国家列表
export function getTradeCountryList() {
return request({
url: "/ecw/region/getTradeCountryList",
method: "get",
});
}
//获取城市列表
export function getCityList(query) {
return request({
url: "/ecw/region/getCityListByParent",
method: "get",
params: query,
});
}
//获取会员积分列表
export function getMemberList(data) {
return request({
url: "/member/user-score/page",
method: "post",
data,
});
}
//批量兑换礼品
export function bulkConversion(data) {
return request({
url: "/reward/redeem/batch",
method: "post",
data,
});
}
......@@ -16,7 +16,7 @@
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(item)">
<i class="el-icon-zoom-in"></i>
</span>
<span class="el-upload-list__item-delete" @click="handleRemove(item)">
<span class="el-upload-list__item-delete" @click="handleRemove(item)" v-if ="isShowEditButton">
<i class="el-icon-delete"></i>
</span>
</span>
......@@ -24,6 +24,7 @@
</ul>
<el-upload
v-if ="isShowEditButton"
multiple
:action="uploadImgUrl"
list-type="picture-card"
......@@ -94,6 +95,11 @@ export default {
isShowTip: {
type: Boolean,
default: true
},
//是否显示编辑按钮
isShowEditButton:{
type: Boolean,
default: true
}
},
data() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,246 +3,254 @@
*
* 数据字典工具类
*/
import store from '@/store'
import i18n from '@/i18n'
import store from "@/store";
import i18n from "@/i18n";
export const DICT_TYPE = {
USER_TYPE: 'user_type',
COMMON_STATUS: 'common_status',
AUDIT_STATUS: 'audit_status',
ADVANCE_STATUS: 'advance_status',
BOX_SHIPMENT_STATUS: 'box_shipment_status',
BOX_SEA_AIR_SHIPMENT_STATUS: 'shipment_sea_air_state',
USER_TYPE: "user_type",
COMMON_STATUS: "common_status",
AUDIT_STATUS: "audit_status",
ADVANCE_STATUS: "advance_status",
BOX_SHIPMENT_STATUS: "box_shipment_status",
BOX_SEA_AIR_SHIPMENT_STATUS: "shipment_sea_air_state",
// ========== SYSTEM 模块 ==========
SYSTEM_USER_SEX: 'system_user_sex',
SYSTEM_MENU_TYPE: 'system_menu_type',
SYSTEM_ROLE_TYPE: 'system_role_type',
SYSTEM_DATA_SCOPE: 'system_data_scope',
SYSTEM_NOTICE_TYPE: 'system_notice_type',
SYSTEM_OPERATE_TYPE: 'system_operate_type',
SYSTEM_LOGIN_TYPE: 'system_login_type',
SYSTEM_LOGIN_RESULT: 'system_login_result',
SYSTEM_SMS_CHANNEL_CODE: 'system_sms_channel_code',
SYSTEM_SMS_TEMPLATE_TYPE: 'system_sms_template_type',
SYSTEM_SMS_SEND_STATUS: 'system_sms_send_status',
SYSTEM_SMS_RECEIVE_STATUS: 'system_sms_receive_status',
SYSTEM_MAIL_SEND_STATUS: 'mail_send_status',
SYSTEM_ERROR_CODE_TYPE: 'system_error_code_type',
INTERNAL_MESSAGE_TYPE: 'internal_message_type',
INTERNAL_MESSAGE_READ_STATUS: 'internal_message_read_status',
SYSTEM_LOCALE: 'system_locale', // 语言列表
SYSTEM_USER_SEX: "system_user_sex",
SYSTEM_MENU_TYPE: "system_menu_type",
SYSTEM_ROLE_TYPE: "system_role_type",
SYSTEM_DATA_SCOPE: "system_data_scope",
SYSTEM_NOTICE_TYPE: "system_notice_type",
SYSTEM_OPERATE_TYPE: "system_operate_type",
SYSTEM_LOGIN_TYPE: "system_login_type",
SYSTEM_LOGIN_RESULT: "system_login_result",
SYSTEM_SMS_CHANNEL_CODE: "system_sms_channel_code",
SYSTEM_SMS_TEMPLATE_TYPE: "system_sms_template_type",
SYSTEM_SMS_SEND_STATUS: "system_sms_send_status",
SYSTEM_SMS_RECEIVE_STATUS: "system_sms_receive_status",
SYSTEM_MAIL_SEND_STATUS: "mail_send_status",
SYSTEM_ERROR_CODE_TYPE: "system_error_code_type",
INTERNAL_MESSAGE_TYPE: "internal_message_type",
INTERNAL_MESSAGE_READ_STATUS: "internal_message_read_status",
SYSTEM_LOCALE: "system_locale", // 语言列表
HELP_DOC_STATUS: 'help_doc_status',
HELP_DOC_STATUS: "help_doc_status",
// ========== INFRA 模块 ==========
INFRA_BOOLEAN_STRING: 'infra_boolean_string',
INFRA_REDIS_TIMEOUT_TYPE: 'infra_redis_timeout_type',
INFRA_JOB_STATUS: 'infra_job_status',
INFRA_JOB_LOG_STATUS: 'infra_job_log_status',
INFRA_API_ERROR_LOG_PROCESS_STATUS: 'infra_api_error_log_process_status',
INFRA_CONFIG_TYPE: 'infra_config_type',
INFRA_CODEGEN_TEMPLATE_TYPE: 'infra_codegen_template_type',
INFRA_CODEGEN_SCENE: 'infra_codegen_scene',
INFRA_FILE_STORAGE: 'infra_file_storage',
INFRA_BOOLEAN_STRING: "infra_boolean_string",
INFRA_REDIS_TIMEOUT_TYPE: "infra_redis_timeout_type",
INFRA_JOB_STATUS: "infra_job_status",
INFRA_JOB_LOG_STATUS: "infra_job_log_status",
INFRA_API_ERROR_LOG_PROCESS_STATUS: "infra_api_error_log_process_status",
INFRA_CONFIG_TYPE: "infra_config_type",
INFRA_CODEGEN_TEMPLATE_TYPE: "infra_codegen_template_type",
INFRA_CODEGEN_SCENE: "infra_codegen_scene",
INFRA_FILE_STORAGE: "infra_file_storage",
// ========== BPM 模块 ==========
BPM_MODEL_CATEGORY: 'bpm_model_category',
BPM_MODEL_FORM_TYPE: 'bpm_model_form_type',
BPM_TASK_ASSIGN_RULE_TYPE: 'bpm_task_assign_rule_type',
BPM_PROCESS_INSTANCE_STATUS: 'bpm_process_instance_status',
BPM_PROCESS_INSTANCE_RESULT: 'bpm_process_instance_result',
BPM_TASK_ASSIGN_SCRIPT: 'bpm_task_assign_script',
BPM_OA_LEAVE_TYPE: 'bpm_oa_leave_type',
BPM_MODEL_CATEGORY: "bpm_model_category",
BPM_MODEL_FORM_TYPE: "bpm_model_form_type",
BPM_TASK_ASSIGN_RULE_TYPE: "bpm_task_assign_rule_type",
BPM_PROCESS_INSTANCE_STATUS: "bpm_process_instance_status",
BPM_PROCESS_INSTANCE_RESULT: "bpm_process_instance_result",
BPM_TASK_ASSIGN_SCRIPT: "bpm_task_assign_script",
BPM_OA_LEAVE_TYPE: "bpm_oa_leave_type",
// ========== PAY 模块 ==========
PAY_CHANNEL_WECHAT_VERSION: 'pay_channel_wechat_version', // 微信渠道版本
PAY_CHANNEL_ALIPAY_SIGN_TYPE: 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型
PAY_CHANNEL_ALIPAY_MODE: 'pay_channel_alipay_mode', // 支付宝公钥类型
PAY_CHANNEL_ALIPAY_SERVER_TYPE: 'pay_channel_alipay_server_type', // 支付宝网关地址
PAY_CHANNEL_CODE_TYPE: 'pay_channel_code_type', // 支付渠道编码类型
PAY_ORDER_NOTIFY_STATUS: 'pay_order_notify_status', // 商户支付订单回调状态
PAY_ORDER_STATUS: 'pay_order_status', // 商户支付订单状态
PAY_ORDER_REFUND_STATUS: 'pay_order_refund_status', // 商户支付订单退款状态
PAY_REFUND_ORDER_STATUS: 'pay_refund_order_status', // 退款订单状态
PAY_REFUND_ORDER_TYPE: 'pay_refund_order_type', // 退款订单类别
ECW_BANK_TYPE: 'bank_type', // 银行账号类型
ECW_DATA_SOURCE: 'data_source', // 数据来源
ECW_REGION_TYPE: 'region_trade_type', // 区域类型
ECW_TRANSPORT_TYPE: 'transport_type', //货运方式
ECW_KYC_DATA: 'member_control_reuest', //会员控单方式
ECW_CHARGE_TYPE: 'warehouse_charge_type', //仓储收费方式
ECW_SHELF_TYPE: 'shelf_type', //货架类型
ECW_PRODUCT_MATERIAL: 'product_material', //商品材质
ECW_PACKAGING_TYPE: 'packaging_type', //包装要求
ECW_CONTAINER_LOCATION: 'container_location', //默认货柜位置
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS: 'special_req_for_line_products', // 特殊需求
ECW_COUPON_TYPE: 'coupon_type', // 优惠券类型
ECW_COUPON_STATUS: 'coupon_status', // 优惠券状态
ECW_COUPON_COST_TYPE: 'coupon_cost_type', // 优惠券费用类型
ECW_COUPON_OVERDUE_STATUS: 'coupon_overdue_status', // 优惠券状态
ECW_COUPON_PUTON_STATUS: 'coupon_puton_status',
ECW_SUITABLE_USER_TYPE: 'suitable_user_type', // 适用用户类型
ECW_SUITABLE_LINE_TYPE: 'suitable_line_type', // 适用线路类型
ECW_SUITABLE_PROD_TYPE: 'suitable_prod_type', // 适用产品类型
ECW_ORDER_ATTR: 'order_attr', // 订单属性
ECW_YESNO: 'yesno', // 是否 1,0
ECW_COMPANY_TYPE: 'company_type', // 供应商类别
ECW_COOPERATION_TYPE: 'cooperation_type', // 合作类型
ECW_SHIPPING_DECLARATION_TYPE: 'shipping_declaration_type', // 出货报关方式(与订单报关方式相同)
ECW_CUSTOMS_TYPE: 'customs_type', // 订单报关方式(非出货报关),优惠券中的单证报关
PAY_CHANNEL_WECHAT_VERSION: "pay_channel_wechat_version", // 微信渠道版本
PAY_CHANNEL_ALIPAY_SIGN_TYPE: "pay_channel_alipay_sign_type", // 支付渠道支付宝算法类型
PAY_CHANNEL_ALIPAY_MODE: "pay_channel_alipay_mode", // 支付宝公钥类型
PAY_CHANNEL_ALIPAY_SERVER_TYPE: "pay_channel_alipay_server_type", // 支付宝网关地址
PAY_CHANNEL_CODE_TYPE: "pay_channel_code_type", // 支付渠道编码类型
PAY_ORDER_NOTIFY_STATUS: "pay_order_notify_status", // 商户支付订单回调状态
PAY_ORDER_STATUS: "pay_order_status", // 商户支付订单状态
PAY_ORDER_REFUND_STATUS: "pay_order_refund_status", // 商户支付订单退款状态
PAY_REFUND_ORDER_STATUS: "pay_refund_order_status", // 退款订单状态
PAY_REFUND_ORDER_TYPE: "pay_refund_order_type", // 退款订单类别
ECW_BANK_TYPE: "bank_type", // 银行账号类型
ECW_DATA_SOURCE: "data_source", // 数据来源
ECW_REGION_TYPE: "region_trade_type", // 区域类型
ECW_TRANSPORT_TYPE: "transport_type", //货运方式
ECW_KYC_DATA: "member_control_reuest", //会员控单方式
ECW_CHARGE_TYPE: "warehouse_charge_type", //仓储收费方式
ECW_SHELF_TYPE: "shelf_type", //货架类型
ECW_PRODUCT_MATERIAL: "product_material", //商品材质
ECW_PACKAGING_TYPE: "packaging_type", //包装要求
ECW_CONTAINER_LOCATION: "container_location", //默认货柜位置
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS: "special_req_for_line_products", // 特殊需求
ECW_COUPON_TYPE: "coupon_type", // 优惠券类型
ECW_COUPON_STATUS: "coupon_status", // 优惠券状态
ECW_COUPON_COST_TYPE: "coupon_cost_type", // 优惠券费用类型
ECW_COUPON_OVERDUE_STATUS: "coupon_overdue_status", // 优惠券状态
ECW_COUPON_PUTON_STATUS: "coupon_puton_status",
ECW_SUITABLE_USER_TYPE: "suitable_user_type", // 适用用户类型
ECW_SUITABLE_LINE_TYPE: "suitable_line_type", // 适用线路类型
ECW_SUITABLE_PROD_TYPE: "suitable_prod_type", // 适用产品类型
ECW_ORDER_ATTR: "order_attr", // 订单属性
ECW_YESNO: "yesno", // 是否 1,0
ECW_COMPANY_TYPE: "company_type", // 供应商类别
ECW_COOPERATION_TYPE: "cooperation_type", // 合作类型
ECW_SHIPPING_DECLARATION_TYPE: "shipping_declaration_type", // 出货报关方式(与订单报关方式相同)
ECW_CUSTOMS_TYPE: "customs_type", // 订单报关方式(非出货报关),优惠券中的单证报关
// ECW_PACKAGE_TYPE: 'packageType', // 包装单位
ECW_DOUBLE_CLEAR: 'double_clear', // 是否双清
ECW_TRADE_TYPE: 'trade_type', // 交货放肆
ECW_OFFER_RESULT: 'offer_result', // 报单结果 赢单 输单
ECW_WAREHOUSING_TYPE: 'warehousing_type', // 入仓类型
ECW_OFFER_STATUS: 'offer_status', // 销售阶段(报价单)
ECW_IS_BRAND: 'is_brand', // 有无品牌
ECW_OFFER_TYPE: 'offer_type', // 跟进类型
ECW_OFFER_METHOD: 'offer_method', // 跟进方式
ECW_RECEIPT_STATE: 'receipt_state',//收款单状态
ECW_RECEIVABLE_STATE: 'receivable_state',//应收明细状态
ECW_SUING_METHOD: 'suing_method', // 出单方式
ECW_HARVEST_METHOD: 'harvest_method', // 收货方式
ECW_PAY_ADVANCE: 'pay_advance', // 是否预付
ECW_BEGINTIME_TYPE_ENDTIME: 'begintime_type_endtime', // 时间筛选字段(订单)
ECW_CUSTOM_DRAWEE: 'custom_drawee', // 自定义付款人费用类型
ECW_IS_DRAFT: 'is_draft', // 草稿发布状态
ECW_PAYMENT_STATE: 'payment_state',//付款单状态
ECW_INVOICING_TYPE: 'invoicing_type',
ECW_PRICE_TYPE: 'price_type',
ECW_RELEASE_STATUS: 'release_status', // 放货状态
ECW_PICK_RECURRENT_NUCLEAR_TYPE: 'PICK_RECURRENT_NUCLEAR_TYPE', // 放货反复核类型
ECW_COST_FEE_TYPE: 'cost_fee_type', // 清单费用类型
ECW_PRICE_AUDIT_STATUS: 'price_audit_status', // 路线价格审核状态
ECW_CANCEL_PICK_TYPE: 'cancel_pick_type', // 取消放货类型
ECW_CUSTOMER_RESOURCE_TYPE: 'customer_resource_type', // 客户资源类型
ECW_CUSTOMER_TRANSPORT_TYPE: 'customer_transport_type', // 客户出货渠道(跟运输方式相同,但是显示全部)
ECW_ORDER_APPROVAL_TYPE: 'order_approval_type', // 订单相关审批类型
ECW_FEE_SOURCE: 'fee_source', // 费用来源
STOCK_UP_EXCEPTION_TYPE: 'stock_up_exception_type', // 备货异常类型,
ORDER_ITEM_PACK_STATUS: 'order_item_pack_status', // 空运备货打包状态
RECEIPT_FEE_TYPE:'receipt_fee_type',
DOWNLOAD_LOG_STATUS: 'download_log_status', // 下载日志状态
DOWNLOAD_TYPE: 'download_type', // 下载类型
ECW_DOUBLE_CLEAR: "double_clear", // 是否双清
ECW_TRADE_TYPE: "trade_type", // 交货放肆
ECW_OFFER_RESULT: "offer_result", // 报单结果 赢单 输单
ECW_WAREHOUSING_TYPE: "warehousing_type", // 入仓类型
ECW_OFFER_STATUS: "offer_status", // 销售阶段(报价单)
ECW_IS_BRAND: "is_brand", // 有无品牌
ECW_OFFER_TYPE: "offer_type", // 跟进类型
ECW_OFFER_METHOD: "offer_method", // 跟进方式
ECW_RECEIPT_STATE: "receipt_state", //收款单状态
ECW_RECEIVABLE_STATE: "receivable_state", //应收明细状态
ECW_SUING_METHOD: "suing_method", // 出单方式
ECW_HARVEST_METHOD: "harvest_method", // 收货方式
ECW_PAY_ADVANCE: "pay_advance", // 是否预付
ECW_BEGINTIME_TYPE_ENDTIME: "begintime_type_endtime", // 时间筛选字段(订单)
ECW_CUSTOM_DRAWEE: "custom_drawee", // 自定义付款人费用类型
ECW_IS_DRAFT: "is_draft", // 草稿发布状态
ECW_PAYMENT_STATE: "payment_state", //付款单状态
ECW_INVOICING_TYPE: "invoicing_type",
ECW_PRICE_TYPE: "price_type",
ECW_RELEASE_STATUS: "release_status", // 放货状态
ECW_PICK_RECURRENT_NUCLEAR_TYPE: "PICK_RECURRENT_NUCLEAR_TYPE", // 放货反复核类型
ECW_COST_FEE_TYPE: "cost_fee_type", // 清单费用类型
ECW_PRICE_AUDIT_STATUS: "price_audit_status", // 路线价格审核状态
ECW_CANCEL_PICK_TYPE: "cancel_pick_type", // 取消放货类型
ECW_CUSTOMER_RESOURCE_TYPE: "customer_resource_type", // 客户资源类型
ECW_CUSTOMER_TRANSPORT_TYPE: "customer_transport_type", // 客户出货渠道(跟运输方式相同,但是显示全部)
ECW_ORDER_APPROVAL_TYPE: "order_approval_type", // 订单相关审批类型
ECW_FEE_SOURCE: "fee_source", // 费用来源
STOCK_UP_EXCEPTION_TYPE: "stock_up_exception_type", // 备货异常类型,
ORDER_ITEM_PACK_STATUS: "order_item_pack_status", // 空运备货打包状态
RECEIPT_FEE_TYPE: "receipt_fee_type",
DOWNLOAD_LOG_STATUS: "download_log_status", // 下载日志状态
DOWNLOAD_TYPE: "download_type", // 下载类型
//--------ecw---------
CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source',
CUSTOMER_BALANCE: 'customer_balance',
CUSTOMER_TYPE: 'customer_type',
CUSTOMER_LEVEL: 'customer_level',
CUSTOMER_COMPLAINT_TYPE: 'customer_complaint_type',
CUSTOMER_COMPLAINT_STATUS: 'customer_complaint_status',
ECW_MESSAGE_LEAVE_TYPE: 'ecw_message_leave_type',
ECW_MESSAGE_LEAVE_STATUS: 'ecw_message_leave_status',
PWD_TYPE: 'pwd_type',
ZHONG_PAO_TYPE: 'zhong_pao_type',
TRANSPORT_TYPE: 'transport_type',
BRAND_REG_TYPE: 'brand_registry_type',
BRAND_AUTH_STATUS: 'brand_authorization_status',
BRAND_CUSTOMER_CHARGING_MODEL: 'customer_charging_model',
COUNTRY: 'country', // 国家地区
AREA_CODE: 'area_code', // 区号
SOCIAL: 'customer_social_tools', // 社交软件
IS_DEFAULT: 'is_default', // 默认联系人
CUSTOMER_FOLLOW_TYPE: 'customer_follow_type', // 跟进类型
CUSTOMER_FOLLOW_METHOD: 'customer_follow_method', // 跟进方式
COMMISSION_PRODUCT_APPROVAL: 'commission_product_approval', //佣金备案
SHIPPING_DECLARATION_TYPE: 'shipping_declaration_type',//出货报关方式(与订单报关方式相同)
COMMISSION_TYPE: 'commission_type',//佣金类型
COMMISSION_DARK_TYPE: 'commission_dark_type',//暗涌类型
CUSTOMER_STATUS: "customer_status",
CUSTOMER_SOURCE: "customer_source",
CUSTOMER_BALANCE: "customer_balance",
CUSTOMER_TYPE: "customer_type",
CUSTOMER_LEVEL: "customer_level",
CUSTOMER_COMPLAINT_TYPE: "customer_complaint_type",
CUSTOMER_COMPLAINT_STATUS: "customer_complaint_status",
ECW_MESSAGE_LEAVE_TYPE: "ecw_message_leave_type",
ECW_MESSAGE_LEAVE_STATUS: "ecw_message_leave_status",
PWD_TYPE: "pwd_type",
ZHONG_PAO_TYPE: "zhong_pao_type",
TRANSPORT_TYPE: "transport_type",
BRAND_REG_TYPE: "brand_registry_type",
BRAND_AUTH_STATUS: "brand_authorization_status",
BRAND_CUSTOMER_CHARGING_MODEL: "customer_charging_model",
COUNTRY: "country", // 国家地区
AREA_CODE: "area_code", // 区号
SOCIAL: "customer_social_tools", // 社交软件
IS_DEFAULT: "is_default", // 默认联系人
CUSTOMER_FOLLOW_TYPE: "customer_follow_type", // 跟进类型
CUSTOMER_FOLLOW_METHOD: "customer_follow_method", // 跟进方式
COMMISSION_PRODUCT_APPROVAL: "commission_product_approval", //佣金备案
SHIPPING_DECLARATION_TYPE: "shipping_declaration_type", //出货报关方式(与订单报关方式相同)
COMMISSION_TYPE: "commission_type", //佣金类型
COMMISSION_DARK_TYPE: "commission_dark_type", //暗涌类型
// COMMISSION_UNIT: 'commission_unit',//佣金货物单位
ECW_PORT_TYPE: 'port_type', //港口类型
CERTIFICATE_TYPE: 'certificate_type',//证件类型
ECW_PORT_TYPE: "port_type", //港口类型
CERTIFICATE_TYPE: "certificate_type", //证件类型
//customer
CUSTOMER_CREDIT_RULE_TYPE: 'customer_credit_rule_type',
CUSTOMER_LEVEL_RULE_TYPE: 'customer_level_rule_type',
CUSTOMER_ESOURCE_TYPE:'customer_resource_type',//客户资源类型
CUSTOMER_OPERATE_TYPE:'customer_operate_type',
CUSTOMER_CREDIT_RULE_TYPE: "customer_credit_rule_type",
CUSTOMER_LEVEL_RULE_TYPE: "customer_level_rule_type",
CUSTOMER_ESOURCE_TYPE: "customer_resource_type", //客户资源类型
CUSTOMER_OPERATE_TYPE: "customer_operate_type",
// order
ORDER_TYPE: 'order_type', // 订单类型
PRODUCT_RECORD_ATTRIBUTE: 'product_record_attribute', //产品备案属性
CONTROL_GOODS_STATUS: 'control_goods_status', //控货状态
DISBURSEMENT_TYPE: 'disbursement_type',//垫付类型
DRAWEE: 'drawee', // 付款人
ORDER_STATUS: 'order_status',//订单状态
ORDER_ITEM_STATUS:'order_item_status',
BEGINTIME_TYPE_ENDTIME: 'begintime_type_endtime',//订单日期筛选类别
ORDER_ERROR_TYPE:'order_error_type',//订单异常类型
ORDER_EXCEPTION_STATUS:'order_exception_status',//异常订单状态
PAYMENT_TYPE:'payment_type',//收款类型
ORDER_WAREHOUSE_IN_STATUS: 'order_warehouse_in_diff_status', // 入仓状态
ORDER_NO_QUOTE_EXCEPTION_RESULT:'order_no_quote_exception_result',//未报价异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT:'order_superfluous_box_exception_result',//多箱异常处理结果
ORDER_LACI_BOX_EXCEPTION_RESULT:'order_lack_box_exception_result',//少箱异常处理结果
ORDER_PAY_EXCEPTION_RESULT:'order_pay_exception_result',//预付异常处理结果
ORDER_MISS_EXCEPTION_RESULT:'order_miss_exception_result',//货物丢失异常处理结果
ORDER_SUPERFLUOUS_GOODS_EXCEPTION_RESULT:'order_superfluous_goods_exception_result',//货物增多异常处理结果
ORDER_DAMAGE_EXCEPTION_RESULT:'order_damage_exception_result',//货物破损异常处理结果
ORDER_IN_WATER_EXCEPTION_RESULT:'order_in_water_exception_result',//货物浸水异常处理结果
ORDER_HEAVY_CARGO_EXCEPTION_RESULT:'order_heavy_cargo_exception_result',//重货异常处理结果
ORDER_DOC_EXCEPTION_RESULT:'order_doc_exception_result',//单证异常处理结果
ORDER_CONSIGNOR_EXCEPTION_RESULT:'order_consignor_exception_result',//发货人异常处理结果
ORDER_COD_EXCEPTION_RESULT:'order_cod_exception_result',//代收货款异常处理结果
ORDER_OTHER_EXCEPTION_RESULT:'order_other_exception_result',//其它异常处理结果
ORDER_BULKY_CARGO_EXCEPTION_RESULT:'order_bulky_cargo_exception_result',//泡货异常处理结果
ORDER_QUERY_PROD_FIELD: 'order_query_prod_field',//订单查询产品字段
ORDER_QUERY_NO_FIELD: 'order_query_no_field',//订单查询非产品字段
NEED_KNOW_TYPE:'need_know_type',//需知类型
NEED_KNOW_STATUS:'need_know_status',//需知状态
MANUAL_EXCEPTION_TYPE:'manual_exception_type',
APPLY_STATUS:'apply_status',//特价申请审核状态
WAREHOUSING_SPECIFICATION_TYPE: 'warehousing_specification_type',
WAREHOUSING_RECORD_DETAIL_USAGE: 'warehousing_record_detail_usage', // 入仓规格类型
ECW_AUTH_TYPE:'auth_type',//品牌授权
OREER_ITEM_USAGE:'order_item_usage',//用途
ORDER_TYPE: "order_type", // 订单类型
PRODUCT_RECORD_ATTRIBUTE: "product_record_attribute", //产品备案属性
CONTROL_GOODS_STATUS: "control_goods_status", //控货状态
DISBURSEMENT_TYPE: "disbursement_type", //垫付类型
DRAWEE: "drawee", // 付款人
ORDER_STATUS: "order_status", //订单状态
ORDER_ITEM_STATUS: "order_item_status",
BEGINTIME_TYPE_ENDTIME: "begintime_type_endtime", //订单日期筛选类别
ORDER_ERROR_TYPE: "order_error_type", //订单异常类型
ORDER_EXCEPTION_STATUS: "order_exception_status", //异常订单状态
PAYMENT_TYPE: "payment_type", //收款类型
ORDER_WAREHOUSE_IN_STATUS: "order_warehouse_in_diff_status", // 入仓状态
ORDER_NO_QUOTE_EXCEPTION_RESULT: "order_no_quote_exception_result", //未报价异常处理结果
ORDER_SUPERFLUOUS_BOX_EXCEPTION_RESULT:
"order_superfluous_box_exception_result", //多箱异常处理结果
ORDER_LACI_BOX_EXCEPTION_RESULT: "order_lack_box_exception_result", //少箱异常处理结果
ORDER_PAY_EXCEPTION_RESULT: "order_pay_exception_result", //预付异常处理结果
ORDER_MISS_EXCEPTION_RESULT: "order_miss_exception_result", //货物丢失异常处理结果
ORDER_SUPERFLUOUS_GOODS_EXCEPTION_RESULT:
"order_superfluous_goods_exception_result", //货物增多异常处理结果
ORDER_DAMAGE_EXCEPTION_RESULT: "order_damage_exception_result", //货物破损异常处理结果
ORDER_IN_WATER_EXCEPTION_RESULT: "order_in_water_exception_result", //货物浸水异常处理结果
ORDER_HEAVY_CARGO_EXCEPTION_RESULT: "order_heavy_cargo_exception_result", //重货异常处理结果
ORDER_DOC_EXCEPTION_RESULT: "order_doc_exception_result", //单证异常处理结果
ORDER_CONSIGNOR_EXCEPTION_RESULT: "order_consignor_exception_result", //发货人异常处理结果
ORDER_COD_EXCEPTION_RESULT: "order_cod_exception_result", //代收货款异常处理结果
ORDER_OTHER_EXCEPTION_RESULT: "order_other_exception_result", //其它异常处理结果
ORDER_BULKY_CARGO_EXCEPTION_RESULT: "order_bulky_cargo_exception_result", //泡货异常处理结果
ORDER_QUERY_PROD_FIELD: "order_query_prod_field", //订单查询产品字段
ORDER_QUERY_NO_FIELD: "order_query_no_field", //订单查询非产品字段
NEED_KNOW_TYPE: "need_know_type", //需知类型
NEED_KNOW_STATUS: "need_know_status", //需知状态
MANUAL_EXCEPTION_TYPE: "manual_exception_type",
APPLY_STATUS: "apply_status", //特价申请审核状态
WAREHOUSING_SPECIFICATION_TYPE: "warehousing_specification_type",
WAREHOUSING_RECORD_DETAIL_USAGE: "warehousing_record_detail_usage", // 入仓规格类型
ECW_AUTH_TYPE: "auth_type", //品牌授权
OREER_ITEM_USAGE: "order_item_usage", //用途
NEED_ORDER_INQUIRY: 'need_order_inquiry', // 是否需要単询
EXCEPTION_SELECT_FILED:'exception_select_filed',
ECASH_INIT:'ecash_init', //e-cash
FEE_TYPE:'receivable_fee_type',
NEED_ORDER_INQUIRY: "need_order_inquiry", // 是否需要単询
EXCEPTION_SELECT_FILED: "exception_select_filed",
ECASH_INIT: "ecash_init", //e-cash
FEE_TYPE: "receivable_fee_type",
// PAY_TYPE:'payment_type',
RECEIVE_FLAG:'receive_flag',
COMDINED_VALUE_ADDED_FEE:'combined_value_added_fee',
ORDER_SPECIAL_NEEDS:'order_special_needs', // 订单特殊需求
ORDER_ABNORMAL_STATE:'order_abnormal_state',
TARGET_TYPE:'target_type',//部门业绩目标类型
CEBE_UNIT:'cube_unit',//目标单位
RECEIPT_ITEM_STATE:'receipt_item_state',//收款单明细状态
RECEIVE_FLAG: "receive_flag",
COMDINED_VALUE_ADDED_FEE: "combined_value_added_fee",
ORDER_SPECIAL_NEEDS: "order_special_needs", // 订单特殊需求
ORDER_ABNORMAL_STATE: "order_abnormal_state",
TARGET_TYPE: "target_type", //部门业绩目标类型
CEBE_UNIT: "cube_unit", //目标单位
RECEIPT_ITEM_STATE: "receipt_item_state", //收款单明细状态
// ========== 出货模块 ==========
BOX_SHIPPING_TRAILER_STATUS: 'shipping_trailer_status', // 拖车状态
BOX_SHIPPING_CUSTOMS_TYPE: 'shipping_customs_type', // 报关方式
BOX_SHIPPING_DCCUSTOMS_STATUS: 'shipping_dcCustoms_status', // 报关放行状态
BOX_SHIPPING_CHECK_STATUS: 'shipping_check_status', // 查验状态
BOX_SHIPPING_UNLOADING_ERROR: 'shipping_unloading_error', // 卸柜异常类型
BOX_SHIPPING_PRICE_UNIT: 'shipping_price_unit', // 金额单位
BOX_SHIPPING_TICKET_EXCEPTION: 'shipping_ticket_exception', // 票异常
BOX_SHIPPING_PROCESS: 'shipping_process', // 海运出货流程
BOX_AIR_SHIPMENT_PROCESS: 'air_shipment_process', // 空运出货
BOX_SEA_AIR: 'shipping_process_sea_air', // 海空联运流程流程
BOX_SHIPPING_BRAND_TYPE: 'shipping_brand_type', // 出货品牌类型
BOX_SHIPPING_NOTICE_TYPE: 'shipping_notice_type', // 出货通知类型
BOX_ORDER_SHIPMENT_STATE: 'order_shipment_state',
BOX_AIR_SHIPMENT_STATE: 'air_shipment_status',
BOX_INSPECTION_TIME_CUSTOMS: 'inspection_time_customs', // 校验时间-报关
BOX_INSPECTION_TIME_SHIPPING: 'inspection_time_shipping', // 校验时间-起运
BOX_INSPECTION_TIME_ARRIVAL: 'inspection_time_arrival', // 校验时间-到港
BOX_SHIPPING_UPDATE_TYPE: "shipping_update_type",// 更新类型
BOX_CUSTOMS_ERROR_TYPE: "customs_error_type",// 报关异常状态
BOX_SHIPPING_ERROR_TYPE: "shipping_error_type",// 起运异常状态
BOX_ARRIVAL_ERROR_TYPE: "arrival_error_type",// 到港异常状态
BOX_FLYING_ERROR_TYPE: 'flying_error_type',// 航班异常状态
SETTLEMENT_STATUS: 'settlement_status', // 结算状态
FLYING_TICKET_EXCEPTION: 'flying_ticket_exception', // 起飞异常
ARRIVAL_TICKET_EXCEPTION: 'arrival_ticket_exception', // 到港异常
CLEARANCE_TICKET_EXCEPTION: 'clearance_ticket_exception', // 清关异常
BOX_SHIPPING_TRAILER_STATUS: "shipping_trailer_status", // 拖车状态
BOX_SHIPPING_CUSTOMS_TYPE: "shipping_customs_type", // 报关方式
BOX_SHIPPING_DCCUSTOMS_STATUS: "shipping_dcCustoms_status", // 报关放行状态
BOX_SHIPPING_CHECK_STATUS: "shipping_check_status", // 查验状态
BOX_SHIPPING_UNLOADING_ERROR: "shipping_unloading_error", // 卸柜异常类型
BOX_SHIPPING_PRICE_UNIT: "shipping_price_unit", // 金额单位
BOX_SHIPPING_TICKET_EXCEPTION: "shipping_ticket_exception", // 票异常
BOX_SHIPPING_PROCESS: "shipping_process", // 海运出货流程
BOX_AIR_SHIPMENT_PROCESS: "air_shipment_process", // 空运出货
BOX_SEA_AIR: "shipping_process_sea_air", // 海空联运流程流程
BOX_SHIPPING_BRAND_TYPE: "shipping_brand_type", // 出货品牌类型
BOX_SHIPPING_NOTICE_TYPE: "shipping_notice_type", // 出货通知类型
BOX_ORDER_SHIPMENT_STATE: "order_shipment_state",
BOX_AIR_SHIPMENT_STATE: "air_shipment_status",
BOX_INSPECTION_TIME_CUSTOMS: "inspection_time_customs", // 校验时间-报关
BOX_INSPECTION_TIME_SHIPPING: "inspection_time_shipping", // 校验时间-起运
BOX_INSPECTION_TIME_ARRIVAL: "inspection_time_arrival", // 校验时间-到港
BOX_SHIPPING_UPDATE_TYPE: "shipping_update_type", // 更新类型
BOX_CUSTOMS_ERROR_TYPE: "customs_error_type", // 报关异常状态
BOX_SHIPPING_ERROR_TYPE: "shipping_error_type", // 起运异常状态
BOX_ARRIVAL_ERROR_TYPE: "arrival_error_type", // 到港异常状态
BOX_FLYING_ERROR_TYPE: "flying_error_type", // 航班异常状态
SETTLEMENT_STATUS: "settlement_status", // 结算状态
FLYING_TICKET_EXCEPTION: "flying_ticket_exception", // 起飞异常
ARRIVAL_TICKET_EXCEPTION: "arrival_ticket_exception", // 到港异常
CLEARANCE_TICKET_EXCEPTION: "clearance_ticket_exception", // 清关异常
APP_TYPE:"app_type", //系统类型
AIR_SHIPMENT_PROCESS:'air_shipment_process',
CUSTOM_CLEARANCE:'custom _clearance', //全部列表空运订单重量上限
AIR_COMMODITY_CUSTOM_CLEARANCE:'air_commodity_custom _clearance'//商品渠道清关费,
}
APP_TYPE: "app_type", //系统类型
AIR_SHIPMENT_PROCESS: "air_shipment_process",
CUSTOM_CLEARANCE: "custom _clearance", //全部列表空运订单重量上限
AIR_COMMODITY_CUSTOM_CLEARANCE: "air_commodity_custom _clearance", //商品渠道清关费,
QUANTITATIVE_RELATION_SYMBOL: "quantitative_relation_symbol", //数量关系符号
WAY_OF_RECEIVING: "way_of_receiving", //领取方式
GIFT_STATUS: "gift_status", //礼品状态
GIFT_ENABLE_STATUS: "gift_enable_status", //礼品启用状态
PLATFORM_TYPE: "platform_type", //平台入口
REWARD_REDEEM_STATUS: "reward_redeem_status", //礼品兑换状态
MEMBER_SCORE_OPERATE_TYPE: "member_user_score_log_operate_type", //会员积分日志操作类型
};
/**
* 获取 dictType 对应的数据字典数组
......@@ -256,7 +264,7 @@ export function getDictDatas(dictType) {
// debugger
// }
// debugger
return store.getters.dict_datas[dictType] || []
return store.getters.dict_datas[dictType] || [];
}
/**
......@@ -289,24 +297,23 @@ export function getDictDatas2(dictType, values) {
export function getDictData(dictType, value) {
// 获取 dictType 对应的数据字典数组
const dictDatas = getDictDatas(dictType)
const dictDatas = getDictDatas(dictType);
if (!dictDatas || dictDatas.length === 0) {
return ''
return "";
}
// 获取 value 对应的展示名
value = value + '' // 强制转换成字符串,因为 DictData 小类数值,是字符串
value = value + ""; // 强制转换成字符串,因为 DictData 小类数值,是字符串
for (const dictData of dictDatas) {
if (dictData.value === value) {
return dictData;
}
}
return undefined
return undefined;
}
export function getDictDataLabel(dictType, value) {
const dict = getDictData(dictType, value);
return dict ? i18n.l(dict, 'label') : '';
return dict ? i18n.l(dict, "label") : "";
}
export class getDictDataL {
}
export class getDictDataL {}
<template>
<el-dialog
:title="$t('选择会员')"
:visible.sync="dialogVisible"
width="80%"
:before-close="dialogBeforeClose"
>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item :label="$t('当前积分')">
<el-row :gutter="10">
<el-col :span="8">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.holdScoreOperate"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="16">
<el-input
v-model.trim="queryParams.holdScore"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('关键词')">
<el-input
style="width: 300px"
v-model.trim="queryParams.key"
:placeholder="$t('请输入会员名称/会员编号/手机号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('国家')">
<el-select
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
clearable
@change="handleGetCityList($event)"
size="small"
>
<el-option
v-for="nodeItem in countryList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('城市')">
<el-select
v-model="queryParams.city"
:placeholder="$t('请选择城市')"
clearable
size="small"
>
<el-option
v-for="nodeItem in cityList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</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>
</el-form-item>
</el-form>
<el-table
ref="multipleTable"
v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList"
>
<el-table-column type="selection" width="55" :selectable="selectable">
</el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column
width="140"
:label="$t('会员编号')"
align="center"
prop="id"
></el-table-column>
<el-table-column
width="140"
:label="$t('手机号')"
align="center"
prop="mobile"
></el-table-column>
<el-table-column
width="140"
align="center"
:label="$t('国家')"
:prop="isChinese ? 'countryNameZh' : 'countryNameEn'"
></el-table-column>
<el-table-column
:label="$t('城市')"
align="center"
:prop="isChinese ? 'cityNameZh' : 'cityNameEn'"
></el-table-column>
<el-table-column
:label="$t('当前积分')"
align="center"
prop="holdScore"
></el-table-column>
</el-table>
<!-- //分页列表 -->
<span v-show="selectedMember.memberList.length > 0"
>{{ $t("已选择:") }} {{ selectedMember.memberName }} {{ $t("") }}
<span style="color: red"> {{ selectedMember.memberList.length }} </span>
{{ $t("") }}</span
>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="handleQueryPagination"
/>
</div>
<div slot="footer">
<el-button @click="dialogBeforeClose">取 消</el-button>
<el-button type="primary" @click="transferSelectMember">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import {
getCityList,
getTradeCountryList,
getMemberList,
} from "@/api/ecw/giftManagement";
import { color } from "echarts/lib/export";
export default {
name: "chooseGift",
props: {
dialogVisible: {
type: Boolean,
default: false,
},
memberSelectList: {
type: Array,
default: () => [],
},
},
watch: {
dialogVisible(val) {
if (val == true) {
this.handleQuery();
}
},
memberSelectList(val) {
this.selectedMember.memberList = val;
},
},
data() {
return {
selectedMember: { memberList: [], memberName: "" },
countryList: [],
cityList: [],
total: 0,
loading: true,
memberList: [],
queryParams: {
country: null,
city: null,
endTime: "",
holdScore: null,
holdScoreOperate: null,
key: "",
pageNo: 1,
pageSize: 10,
startTime: "",
usedScore: 0,
usedScoreOperate: 0,
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.handleQuery();
this.getCountryList();
},
activated() {
this.handleQuery();
},
methods: {
selectable(row, index) {
if (this.memberSelectList.length > 0) {
return this.memberSelectList.some((item) => {
return item.id != row.id;
});
} else {
return true;
}
},
handleSelectionChange(val) {
this.selectedMember.memberList = val;
let arraryMemberName = [];
if (val) {
this.selectedMember.memberList.forEach((element) => {
if (this.isChinese) {
arraryMemberName.push(element.memberNameZh);
} else {
arraryMemberName.push(element.memberNameEn);
}
});
}
this.selectedMember.memberName = arraryMemberName.join("");
},
transferSelectMember() {
this.dialogBeforeClose();
this.$emit("transferSelectMemberInfo", this.selectedMember.memberList);
},
dialogBeforeClose() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
// this.dialogVisible = false;
this.$emit("update:dialogVisible", false);
},
getCountryList() {
getTradeCountryList().then((res) => {
this.countryList = res.data;
});
},
handleGetCityList(id) {
let params = {
id: id,
};
getCityList(params).then((res) => {});
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
handleQueryPagination() {
let params = { ...this.queryParams };
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
resetQuery() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
this.handleQuery();
},
},
};
</script>
<template>
<div class="app-container">
<el-button type="success" @click="handleSelectMember">
{{ $t("添加会员") }}</el-button
>
<div class="container">
<div v-if="memberList.length > 0">
<div
class="formBox"
v-for="(item, index) in queryParamsList"
:key="item.memberId"
>
<el-form
:model="queryParamsList[index]"
:ref="`queryForm${item.memberId}`"
size="small"
:inline="true"
:rules="rules"
label-width="168px"
>
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-row :gutter="10">
<span class="card-title">{{ $t("基础信息") }}</span>
<el-button
style="padding: 0 10px"
@click="handleExpand(item)"
type="text"
>{{ item.expand ? $t("收起") : $t("展开")
}}<i
:class="
item.expand
? 'el-icon-caret-top'
: 'el-icon-caret-bottom'
"
></i
></el-button>
<el-button
type="text"
@click="handleDelete(index, item)"
class="del-btn"
>{{ $t("删除") }}</el-button
>
</el-row>
<el-row :gutter="10">
<el-form-item :label="$t('会员名称')">
<el-input
:placeholder="$t('请输入会员名称')"
clearable
:disabled="true"
v-model="item.memberName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('当前积分')">
<el-input
:placeholder="$t('请输入当前积分')"
clearable
:disabled="true"
v-model="item.holdScore"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('礼品选择')">
<el-input
:placeholder="$t('请选择礼品')"
clearable
:disabled="true"
v-model="item.rewardName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('礼品积分')">
<el-input
:placeholder="$t('请输入礼品积分')"
clearable
:disabled="true"
v-model="item.pointsRequire"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换数量')" prop="rewardCount">
<el-input
:placeholder="$t('请输入兑换数量')"
clearable
v-model.number="item.rewardCount"
@change="
(val) => {
handleRewardCount(item, index, val);
}
"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('本次兑换积分')">
<el-input
:placeholder="$t('请输入本次兑换积分')"
clearable
:disabled="true"
v-model="item.spendCredit"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换后剩余积分')">
<el-input
:placeholder="$t('兑换后剩余积分')"
clearable
:disabled="true"
v-model="item.remainingPoints"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
</el-row>
<el-row :gutter="10" v-show="item.expand">
<el-row>
<span class="card-title">{{ $t("详细信息") }}</span>
</el-row>
<el-row>
<el-form-item :label="$t('兑换方式')" prop="redeemType">
<dict-selector
clearable
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="item.redeemType"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换入口')">
<dict-selector
clearable
:disabled="true"
v-model="item.entrance"
:type="DICT_TYPE.PLATFORM_TYPE"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('费用')" required>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item prop="expenses">
<el-input
v-model="item.expenses"
:placeholder="$t('请输入数字')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item prop="currency">
<el-select
v-model="item.currency"
:placeholder="$t('请选择币种')"
>
<el-option
v-for="nodeItem in currencyList"
:key="nodeItem.id"
:label="
isChinese
? nodeItem.titleZh
: nodeItem.titleEn
"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('收件人姓名')" prop="recipientName"
><el-input
:placeholder="$t('请输入收件人姓名')"
clearable
v-model="item.recipientName"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('收件人电话')"
prop="recipientPhoneNum"
>
<el-input
:placeholder="$t('请输入收件人电话')"
clearable
v-model="item.recipientPhoneNum"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('收件人地址')"
prop="recipientAddress"
v-if="item.redeemType != '1'"
>
<el-input
:placeholder="$t('请输入收件人地址')"
clearable
v-model="item.recipientAddress"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换人')">
<el-input
:placeholder="$t('请输入兑换人')"
clearable
v-model="item.redeemer"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换时间')">
<el-date-picker
type="date"
placement="bottom-start"
value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择兑换时间')"
v-model="item.redemptionTime"
></el-date-picker>
</el-form-item>
<el-form-item
:label="$t('快递公司')"
v-if="item.redeemType != '1'"
>
<el-select
v-model="item.courierCompany"
:placeholder="$t('请选择快递公司')"
>
<el-option
v-for="nodeItem in expressList"
:key="nodeItem.id"
:label="nodeItem.companyName"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item
:label="$t('快递单号')"
v-if="item.redeemType != '1'"
>
<el-input
:placeholder="$t('请输入快递单号')"
clearable
v-model="item.expressNo"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item
:label="$t('快递日期')"
v-if="item.redeemType != '1'"
>
<el-date-picker
type="date"
:placeholder="$t('选择快递日期')"
v-model="item.expressDate"
value-format="yyyy-MM-dd HH:mm:ss"
placement="bottom-start"
></el-date-picker>
</el-form-item>
<el-form-item :label="$t('快递寄出人')">
<el-input
:placeholder="$t('请输入快递寄出人')"
clearable
v-model="item.expressSender"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('上传附件')">
<file-upload v-model="item.annex"></file-upload>
</el-form-item>
<el-form-item :label="$t('备注')">
<el-input
style="width: 500px"
type="textarea"
v-model="item.remark"
></el-input>
</el-form-item>
</el-row>
</el-row>
</div>
</el-card>
</el-form>
</div>
</div>
<div v-else class="emptyText">
{{ $t("请先添加准备兑换礼品的会员") }}
</div>
<el-row justify="end" :gutter="20" type="flex" class="handleButton">
<el-col :span="2">
<el-button
v-if="memberList.length > 0"
type="primary"
@click="handleBulkConversion"
>{{ $t("确认兑换") }}</el-button
>
</el-col>
<el-col :span="2">
<el-button @click="handleBack">{{ $t("返回") }}</el-button>
</el-col>
</el-row>
</div>
<choose-Gift
:dialogVisible.sync="dialogVisible"
@transferSelectMemberInfo="onGetSelectMemberInfo"
:memberSelectList="memberList"
>
</choose-Gift>
</div>
</template>
<script>
import { getRewardsDetails, bulkConversion } from "@/api/ecw/giftManagement";
import FileUpload from "@/components/FileUpload";
import chooseGift from "./components/chooseGift.vue";
import { getExpressPage } from "@/api/ecw/express";
import { getCurrencyList } from "@/api/ecw/currency";
import { getNowDateTime } from "@/utils/ruoyi";
import { number } from "echarts/lib/export";
export default {
name: "giftManagementList",
components: {
chooseGift,
FileUpload,
},
data() {
var validatePass2 = (rule, value, callback) => {
if (!this.quantityComputation) {
return callback(
new Error(this.$t("兑换积分大于当前总积分,请重新输入兑换数量"))
);
} else {
return callback();
}
};
return {
env: process.env.NODE_ENV,
// 是否显示弹出层
dialogVisible: false,
// 查询参数
queryParamsList: [],
// 网点
nodeList: [],
//快递公司列表
expressList: [],
memberList: [],
currencyList: [],
quantityComputation: null,
checkFormResult: [],
rules: {
rewardCount: [
{
required: true,
message: this.$t("请输入兑换数量"),
trigger: "blur",
},
{
validator: validatePass2,
trigger: "blur",
},
],
expenses: [
{
required: true,
message: this.$t("请输入费用"),
trigger: "blur",
},
{
pattern: /^\d+(\.\d{1,2})?$/,
message: this.$t("请输入整数或保留小数点后两位"),
trigger: "blur",
},
],
currency: [
{
required: true,
message: this.$t("请选择币种"),
trigger: "change",
},
],
redeemType: [
{
required: true,
message: this.$t("请选择兑换方式"),
trigger: "change",
},
],
recipientName: [
{
required: true,
message: this.$t("请输入收件人姓名"),
trigger: "blur",
},
],
recipientPhoneNum: [
{
required: true,
message: this.$t("请输入收件人电话"),
trigger: "blur",
},
],
recipientAddress: [
{
required: true,
message: this.$t("请输入收件人地址"),
trigger: "blur",
},
],
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getRewardsDetailsAPI();
this.getExpressList();
this.currencyListAPI();
},
activated() {},
methods: {
handleRewardCount(item, index, value) {
this.queryParamsList[index].spendCredit =
this.queryParamsList[index].pointsRequire * value;
this.queryParamsList[index].remainingPoints =
this.queryParamsList[index].holdScore -
this.queryParamsList[index].spendCredit;
this.quantityComputation =
this.queryParamsList[index].remainingPoints >= 0 ? true : false;
},
handleDelete(index, item) {
this.$modal
.confirm(this.$t("是否确认删除此数据"))
.then(() => {
this.queryParamsList.splice(index, 1);
this.memberList = this.memberList.filter(
(res) => res.id != item.memberId
);
this.$modal.msgSuccess(this.$t("删除成功"));
})
.catch(() => {});
},
handleExpand(item) {
this.queryParamsList.forEach((element) => {
if (element.memberId == item.memberId) {
element.expand = !item.expand;
}
});
},
currencyListAPI() {
getCurrencyList().then((res) => {
this.currencyList = res.data;
});
},
onGetSelectMemberInfo(data) {
if (data.length > 0) {
data.filter((item) => {
let inculde = this.queryParamsList.some((itemQuery) => {
return item.id == itemQuery.memberId;
});
if (!inculde) {
let queryParams = {
expand: true,
memberId: item.id,
holdScore: item.holdScore,
rewardId: this.rewardsDetails.id,
pointsRequire: this.rewardsDetails.pointsRequire,
rewardCount: null,
spendCredit: null, //本次兑换花费积分
remainingPoints: null, //剩余积分
redeemType: null,
entrance: 1,
expenses: null,
currency: null,
recipientName: null,
recipientPhoneNum: null,
recipientAddress: null,
redeemer: this.$store.getters.name,
redemptionTime: getNowDateTime("00:00:00"),
courierCompany: null,
expressNo: null,
expressSender: this.$store.getters.name,
expressDate: null,
remark: null,
annex: null,
};
if (this.isChinese) {
queryParams.memberName = item.memberNameZh;
queryParams.rewardName = this.rewardsDetails.titleZh;
} else {
queryParams.memberName = item.memberNameEn;
queryParams.rewardName = this.rewardsDetails.titleEn;
}
this.memberList.push(item);
this.queryParamsList.push({ ...queryParams });
}
});
}
},
handleSelectMember() {
this.dialogVisible = true;
},
getExpressList() {
let params = {
pageNo: 1,
pageSize: 1000,
};
getExpressPage(params).then((res) => {
this.expressList = res.data.list;
});
},
getRewardsDetailsAPI() {
let params = {
id: this.$route.query.rewardsID,
};
getRewardsDetails(params).then((res) => {
this.rewardsDetails = res.data;
});
},
handleBack() {
this.$store.dispatch("tagsView/delCurrentView");
},
checkForm(formName) {
const result = new Promise((resolve, reject) => {
this.$refs[formName][0].validate((valid) => {
if (valid) {
resolve();
} else {
reject();
}
});
});
this.checkFormResult.push(result);
},
handleBulkConversion() {
this.queryParamsList.forEach((element) => {
this.checkForm(`queryForm${element.memberId}`);
});
Promise.all(this.checkFormResult)
.then((res) => {
this.checkFormResult = [];
let params = this.queryParamsList.map((item) => {
if (item.redeemType == "1") {
let {
recipientAddress,
expressNo,
expressDate,
courierCompany,
...itemNew
} = item;
return itemNew;
} else {
return item;
}
});
bulkConversion(params).then((res) => {
if (res.data.code == "0") {
this.queryParamsList = [];
this.memberList = [];
this.$message.success(this.$t("兑换成功"));
}
});
})
.catch(() => {
this.checkFormResult = [];
this.$message.error(this.$t("兑换失败,请填写必要的信息"));
});
},
},
};
</script>
<style scoped lang="scss">
.card-title {
padding-right: 10px;
border-right: 4px solid rgb(64, 158, 255);
font-size: 16px;
font-weight: 600;
}
.del-btn {
color: red;
}
.app-container .el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 194px;
}
.container {
padding: 20px 0;
}
.emptyText {
font-size: 20px;
padding: 20px;
line-height: 200px;
text-align: center;
color: #97a8be;
}
.handleButton {
padding-right: 160px;
margin-top: 50px;
button {
width: 100%;
}
}
</style>
<template>
<el-dialog :title="$t(titleLabel)" :visible="show" @close="close" width="80%">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:rules="rules"
label-width="120px"
>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('中文礼品名称')" prop="titleZh">
<el-input
v-model.trim="queryParams.titleZh"
:placeholder="$t('请输入')"
:disabled="isDisable"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('英文礼品名称')" prop="titleEn">
<el-input
v-model.trim="queryParams.titleEn"
:disabled="isDisable"
:placeholder="$t('请输入')"
clearable
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('中文礼品图片')" prop="number">
<image-upload
v-model="queryParams.imgZh"
:isShowEditButton="!isDisable"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('英文礼品图片')" prop="number">
<image-upload
v-model="queryParams.imgEn"
:isShowEditButton="!isDisable"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item :label="$t('兑换积分')" prop="pointsRequire">
<el-input
v-model.trim="queryParams.pointsRequire"
:placeholder="$t('请输入')"
:disabled="isDisable"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换网点')" prop="nodeId">
<el-select
v-model="queryParams.nodeId"
:placeholder="$t('请选择兑换网点')"
:disabled="isDisable"
clearable
size="small"
>
<el-option
v-for="nodeItem in nodeList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('剩余数量')" prop="quantityRemain">
<el-input
:disabled="isDisable && disabelEnableStatus"
v-model.trim="queryParams.quantityRemain"
:placeholder="$t('请输入')"
type="number"
/>
</el-form-item>
<el-form-item :label="$t('活动时间')" prop="dateRangeCreateTime">
<el-date-picker
:disabled="isDisable"
type="datetimerange"
clearable
placement="bottom-start"
v-model="queryParams.dateRangeCreateTime"
style="width: 400px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('领取方式')" prop="pickMethod">
<dict-selector
clearable
multiple
:disabled="isDisable"
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.pickMethod"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('允许兑换次数')" prop="allowCount">
<el-input
v-model.trim="queryParams.allowCount"
:placeholder="$t('请输入')"
clearable
:disabled="isDisable"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('中文备注')" prop="remarkZh">
<el-input
type="textarea"
:disabled="isDisable && disabelEnableStatus"
height="100"
v-model="queryParams.remarkZh"
:placeholder="$t('请输入')"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('英文备注')" prop="remarkEn">
<el-input
type="textarea"
:disabled="isDisable && disabelEnableStatus"
v-model="queryParams.remarkEn"
:placeholder="$t('请输入')"
></el-input>
</el-form-item>
</el-col>
</el-row>
<div>
<el-form-item :label="$t('是否启用')" prop="status" v-if="title == '3'">
<el-radio-group v-model="queryParams.status" :disabled="isDisable">
<el-radio
v-for="dict in getDictDatas(DICT_TYPE.GIFT_ENABLE_STATUS)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('状态')" prop="status" v-else>
<el-radio-group v-model="queryParams.status" :disabled="isDisable">
<el-radio
v-for="dict in getDictDatas(DICT_TYPE.GIFT_STATUS)"
:key="dict.value"
:label="Number(dict.value)"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-form-item>
</div>
</el-form>
<div
slot="footer"
class="dialog-footer"
v-if="!isDisable || !disabelEnableStatus"
>
<el-button @click="close">{{ $t("取 消") }}</el-button>
<el-button type="primary" @click="submit">{{ $t("确 定") }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { editRewards, addRewards } from "@/api/ecw/giftManagement";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import imageUpload from "@/components/ImageUpload";
import { parseTime, resetForm } from "../../../../utils/ruoyi";
import { deepClone } from "@/utils";
export default {
name: "operatingGift",
props: {
title: {
type: String,
default: "",
},
show: {
type: Boolean,
default: false,
},
rewardsDetails: {
type: Object,
default: () => {
return this.queryParams;
},
},
nodeList: {
type: Array,
default: () => [],
},
},
components: {
imageUpload,
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
isDisable() {
let disableStatus = false;
switch (this.title) {
case "1":
disableStatus = true;
this.disabelEnableStatus = true;
break;
case "2":
if (this.queryParams.status == "2") {
disableStatus = false;
this.disabelEnableStatus = true;
} else if (this.queryParams.status == "1") {
disableStatus = true;
this.disabelEnableStatus = false;
} else {
disableStatus = true;
this.disabelEnableStatus = true;
}
break;
case "3":
disableStatus = false;
break;
}
return disableStatus;
},
titleLabel() {
let titleLabelText = "";
switch (this.title) {
case "1":
titleLabelText = this.$t("查看礼品");
break;
case "2":
titleLabelText = this.$t("编辑礼品");
break;
case "3":
this.resetFormQuery();
titleLabelText = this.$t("新增礼品");
break;
}
return titleLabelText;
},
},
watch: {
rewardsDetails(newVal, oldVal) {
if (JSON.stringify(newVal) != "{}") {
this.queryParams = deepClone(newVal);
this.queryParams.dateRangeCreateTime = [
parseTime(newVal.startTime),
parseTime(newVal.endTime),
];
this.queryParams.pickMethod = newVal.pickMethod.split(",");
} else {
this.resetFormQuery();
this.$refs["queryForm"].resetFields();
console.log("Prop is empty");
}
},
},
data() {
return {
queryParams: {
allowCount: null,
endTime: null,
imgEn: null,
imgZh: null,
nodeId: null,
pickMethod: null,
pointsRequire: null,
quantityRemain: null,
remarkEn: null,
remarkFr: null,
remarkZh: null,
startTime: null,
status: null,
titleEn: null,
titleZh: null,
dateRangeCreateTime: null,
},
disabelEnableStatus: false,
rules: {
titleZh: [
{
required: true,
message: this.$t("请输入中文礼品名称"),
trigger: "blur",
},
{
min: 0,
max: 50,
message: this.$t("长度在 0 到 50 个字符"),
trigger: "blur",
},
],
titleEn: [
{
required: true,
message: this.$t("请输入英文礼品名称"),
trigger: "blur",
},
{
min: 0,
max: 50,
message: this.$t("长度在 0 到 50 个字符"),
trigger: "blur",
},
],
pointsRequire: [
{
required: true,
message: this.$t("请输入兑换积分"),
trigger: "blur",
},
],
nodeId: [
{ required: true, message: this.$t("请选择网点"), trigger: "change" },
],
quantityRemain: [
{
required: true,
message: this.$t("请输入剩余数量"),
trigger: "blur",
},
],
pickMethod: [
{
required: true,
message: this.$t("请选择领取方式"),
trigger: "change",
},
],
allowCount: [
{
required: true,
message: this.$t("请输入允许兑换次数"),
trigger: "blur",
},
],
remarkZh: [
{
min: 0,
max: 500,
message: this.$t("长度在 0 到 500 个字符"),
trigger: "blur",
},
],
remarkEn: [
{
min: 0,
max: 500,
message: this.$t("长度在 0 到 500 个字符"),
trigger: "blur",
},
],
status: [
{
required: true,
message: this.$t("请选择是否启用"),
trigger: "change",
},
],
},
};
},
methods: {
submit() {
let params = { ...this.queryParams };
params.startTime = this.queryParams.dateRangeCreateTime[0];
params.endTime = this.queryParams.dateRangeCreateTime[1];
params.pickMethod = this.queryParams.pickMethod.toString();
this.$refs["queryForm"].validate((valid) => {
if (this.title == "2") {
editRewards(params).then((res) => {
this.$emit("update:show", false);
this.$message.success(this.$t("编辑成功"));
this.$refs["queryForm"].resetFields();
this.$parent.getList();
});
} else {
//Add
addRewards(params).then((res) => {
this.$emit("update:show", false);
this.$message.success(this.$t("成功"));
this.$refs["queryForm"].resetFields();
});
}
});
},
close() {
this.$emit("update:show", false);
},
resetFormQuery() {
this.queryParams = {
allowCount: null,
endTime: null,
imgEn: null,
imgZh: null,
nodeId: null,
pickMethod: null,
pointsRequire: null,
quantityRemain: null,
remarkEn: null,
remarkFr: null,
remarkZh: null,
startTime: null,
status: null,
titleEn: null,
titleZh: null,
dateRangeCreateTime: null,
};
},
},
};
</script>
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item :label="$t('礼品名称')">
<el-input
v-model.trim="queryParams.title"
:placeholder="$t('请输入礼品名称')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('兑换积分')">
<el-row :gutter="10">
<el-col :span="8">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.pointsRequireSymbol"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="16">
<el-input
v-model.trim="queryParams.pointsRequire"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('领取方式')" prop="level">
<dict-selector
clearable
:type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.pickMethod"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('兑换网点')" prop="level">
<el-select
v-model="queryParams.nodeId"
:placeholder="$t('请选择兑换网点')"
clearable
size="small"
@change="handleQuery"
>
<el-option
v-for="nodeItem in nodeList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('状态')" prop="level">
<dict-selector
clearable
:type="DICT_TYPE.GIFT_STATUS"
v-model="queryParams.status"
@change="handleQuery"
>
</dict-selector>
</el-form-item>
<el-form-item :label="$t('备注')" prop="level">
<el-input
v-model.trim="queryParams.remark"
:placeholder="$t('请输入备注')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('剩余数量')">
<el-row :gutter="10">
<el-col :span="8">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.quantityRemainSymbol"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="16">
<el-input
v-model.trim="queryParams.quantityRemain"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-date-picker
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</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>
</el-form-item>
</el-form>
<el-row class="mb8">
<el-button
type="success"
size="mini"
icon="el-icon-plus"
@click="handleAddReward"
v-hasPermi="['ecw:giftManagement:add']"
>{{ $t("添加礼品") }}</el-button
>
</el-row>
<!-- 礼品列表 -->
<el-table ref="multipleTable" v-loading="loading" :data="list">
<el-table-column
width="140"
:label="$t('礼品ID')"
align="center"
prop="code"
></el-table-column>
<el-table-column :label="$t('礼品名称')" align="center">
<template slot-scope="scope">
{{ row }}
<el-button type="text" @click="handleView(scope.row)">{{
isChinese ? scope.row.titleZh : scope.row.titleEn
}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('图片')">
<template slot-scope="scope">
<el-image
:src="firstImg(isChinese ? scope.row.imgZh : scope.row.imgEn)"
style="width: 50px; height: 50px"
>{{ $t("") }}</el-image
>
</template>
</el-table-column>
<el-table-column width="160" :label="$t('开始日期')">
<template v-slot="{ row }">
{{ parseTime(row.createTime) || "/" }}
</template>
</el-table-column>
<el-table-column width="160" :label="$t('结束日期')">
<template v-slot="{ row }">
{{ parseTime(row.endTime) || "/" }}
</template>
</el-table-column>
<el-table-column
:label="$t('兑换积分')"
prop="pointsRequire"
></el-table-column>
<el-table-column :label="$t('领取方式')" align="center" prop="pickMethod">
<template v-slot="{ row }">
{{ handlePickMethod(row.pickMethod) }}
</template>
</el-table-column>
<el-table-column :label="$t('兑换网点')" align="center">
<template v-slot="{ row }">
{{
isChinese
? handleExchangeNodeId(row.nodeId).titleZh
: handleExchangeNodeId(row.nodeId).titleEn
}}
</template>
</el-table-column>
<el-table-column
:label="$t('允许兑换次数')"
align="center"
prop="allowCount"
></el-table-column>
<el-table-column :label="$t('状态')">
<template slot-scope="{ row }">
{{
isChinese
? handleRewardsStatus(row.status).label
: handleRewardsStatus(row.status).labelEn
}}
</template>
</el-table-column>
<el-table-column :label="$t('备注')" align="center" width="200">
<template slot-scope="{ row }">
<el-tooltip
popper-class="rewardstToolTip"
:content="isChinese ? row.remarkZh : remarkEn"
placement="top"
>
<div
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
{{ isChinese ? row.remarkZh : remarkEn }}
</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
:label="$t('已兑换次数')"
align="center"
prop="exchangeCount"
></el-table-column>
<el-table-column
:label="$t('剩余次数')"
align="center"
prop="quantityRemain"
></el-table-column>
<el-table-column
width="220px"
align="center"
:label="$t('操作')"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['ecw:giftManagement:check']"
>{{ $t("查看") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCloseStatus(scope.row)"
:disabled="scope.row.status == '2'"
v-hasPermi="['ecw:giftManagement:close']"
>{{ $t("关闭") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="copyRewards(scope.row)"
v-hasPermi="['ecw:giftManagement:copy']"
>{{ $t("复制") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handlePostpone(scope.row)"
:disabled="scope.row.status != '1'"
v-hasPermi="['ecw:giftManagement:postpone']"
>{{ $t("延期") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
:disabled="scope.row.status != '2'"
v-hasPermi="['ecw:giftManagement:delete']"
>{{ $t("删除") }}</el-button
>
<el-button
size="mini"
v-has-permi="['ecw:giftManagement:edit']"
type="text"
:disabled="scope.row.status != '2' && scope.row.status != '1'"
icon="el-icon-collection"
@click="editRewards(scope.row)"
>{{ $t("编辑") }}</el-button
>
<el-button
size="mini"
v-has-permi="['ecw:giftManagement:enable']"
type="text"
icon="el-icon-user"
@click="handleLaunchRewards(scope.row)"
>{{ $t("启用") }}</el-button
>
<el-button
:disabled="scope.row.isInOpenSea"
v-has-permi="['ecw:giftManagement:exchange']"
size="mini"
type="text"
icon="el-icon-user"
@click="handleExchange(scope.row)"
>{{ $t("兑换") }}</el-button
>
</template>
</el-table-column>
</el-table>
<!-- //分页列表 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 编辑 新增弹窗 -->
<operating-gift
ref="operatingGift"
:title="operatingPagetitle"
:rewardsDetails="rewardsItem"
:show.sync="dialogVisible"
:nodeList="nodeList"
>
</operating-gift>
<el-dialog
:title="$t('提示')"
:visible.sync="dialogPostponeVisible"
width="30%"
>
<el-row class="mb8">{{ $t("请选择延期时间") }}</el-row>
<el-date-picker
type="datetime"
clearable
v-model="postponeDatetime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
:placeholder="$t('请选择时间')"
></el-date-picker>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogPostponeVisible = false">{{
$t("取 消")
}}</el-button>
<el-button type="primary" @click="confirmPostponeRewards">{{
$t("确 定")
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getNodeList,
getGiftList,
deleteRewards,
copyRewardsAPI,
changeRewardsStatus,
delayRewards,
} from "@/api/ecw/giftManagement";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { parseTime } from "../../../utils/ruoyi";
import OperatingGift from "@/views/ecw/giftManagement/components/operatingGift.vue";
import { uploadFile } from "@/api/infra/file";
import ImageUpload from "@/components/ImageUpload";
export default {
name: "giftManagementList",
components: {
OperatingGift,
},
data() {
return {
env: process.env.NODE_ENV,
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 礼品列表
list: [],
// 弹出层标题
operatingPagetitle: "",
// 是否显示弹出层
dialogVisible: false,
rewardsItem: {},
dateRangeCreateTime: [],
postponeDatetime: "",
postponeRewardsID: "",
dialogPostponeVisible: false,
// 查询参数
queryParams: {
page: 1,
rows: 10,
title: null,
pointsRequire: null,
pointsRequireSymbol: null,
pickMethod: null,
nodeId: null,
status: null,
remark: null,
quantityRemainSymbol: null,
quantityRemain: null,
beginCreateTime: null,
endCreateTime: null,
},
// 网点
nodeList: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
},
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.getList();
this.getNodeList();
},
activated() {
this.getList();
},
methods: {
arraysEqual(arr1, arr2) {
return arr1.filter((current) => {
return arr2.find((item) => item == current.value.toString())
? true
: false;
});
},
handleRewardsStatus(status) {
return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter(
(dicItem) => dicItem.value.toString() == status
)[0];
},
firstImg(imgString) {
if (!imgString || imgString == "") return imgString;
let imgs = imgString.split(",");
return imgs.length ? imgs[0] : null;
},
handlePickMethod(pickMethod) {
let pickMethodLabel = [];
if (this.isChinese) {
this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(",")
).forEach((element) => {
pickMethodLabel.push(element.label);
});
} else {
this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(",")
).forEach((element) => {
pickMethodLabel.push(element.labelEn);
});
}
return pickMethodLabel.join();
},
handleExchangeNodeId(nodeId) {
return this.nodeList.filter((nodeItem) => nodeItem.id == nodeId)[0];
},
handleAddReward() {
this.rewardsItem = {};
this.dialogVisible = true;
this.operatingPagetitle = "3";
},
handleExchange(row) {
this.$router.push({
path: "/giftManagement/bulkExchange",
query: { rewardsID: row.id },
});
},
/** 延期按钮操作 */
handlePostpone(row) {
this.postponeRewardsID = row.id;
this.dialogPostponeVisible = true;
},
confirmPostponeRewards() {
this.dialogPostponeVisible = false;
delayRewards({
id: this.postponeRewardsID,
endTime: this.postponeDatetime,
}).then((res) => {
this.$message.success(this.$t("延期成功"));
});
},
/** 关闭按钮操作 */
handleCloseStatus(row) {
this.$confirm(this.$t("是否关闭当前礼品?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then((_) => {
return changeRewardsStatus({ id: row.id, status: "3" });
})
.then((res) => {
this.getList();
this.$message.success(this.$t("关闭成功"));
})
.catch((_) => {
// this.queryAllData();
});
},
//启用礼品状态
handleLaunchRewards(row) {
this.$confirm(this.$t("是否启用当前礼品?"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
type: "warning",
})
.then(() => {
changeRewardsStatus({ id: row.id, status: "1" }).then((r) => {
this.$message.success(this.$t("启用成功"));
this.getList();
});
})
.catch(() => {});
},
getNodeList() {
getNodeList().then((res) => {
this.nodeList = res.data;
});
},
getList() {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
getGiftList(params).then((res) => {
this.loading = false;
this.list = res.data.list;
this.total = res.data.total;
});
},
// 新增潜在客户
handleAddPotential() {
this.$refs.potentialCustom.dialogTableVisible = true;
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(this.$t("是否确认删除此礼品"))
.then(function () {
return deleteRewards({ id: row.id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
})
.catch(() => {});
},
/** 搜索按钮操作 */
handleQuery() {
this.$nextTick(() => {
this.queryParams.page = 1;
this.getList();
});
},
/** 查看按钮操作 */
handleView(row) {
this.dialogVisible = true;
this.operatingPagetitle = "1";
this.rewardsItem = row;
},
/** 编辑按钮操作 */
editRewards(row) {
this.dialogVisible = true;
this.operatingPagetitle = "2";
this.rewardsItem = row;
},
/** 复制按钮操作 */
copyRewards(row) {
copyRewardsAPI(row.id).then((res) => {
this.$modal.msgSuccess(this.$t("复制成功"));
this.handleQuery();
});
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.queryParams = {
page: 1,
rows: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null,
};
this.handleQuery();
},
},
};
</script>
<style>
.rewardstToolTip {
max-width: 90%;
}
</style>
<template>
<div class="app-container">兑换记录</div>
</template>
<template>
<div class="app-container">积分记录</div>
</template>
<template>
<div class="app-container">积分规则</div>
</template>
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
label-width="120px"
>
<el-form-item :label="$t('关键词')">
<el-input
style="width: 300px"
v-model.trim="queryParams.key"
:placeholder="$t('请输入会员名称/会员编号/手机号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('国家')">
<el-select
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
clearable
size="small"
>
<el-option
v-for="nodeItem in countryList"
:key="nodeItem.id"
:label="isChinese ? nodeItem.titleZh : nodeItem.titleEn"
:value="nodeItem.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('当前积分')">
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.holdScoreOperate"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.holdScore"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('已兑换积分')">
<el-row :gutter="10" style="width: 300px">
<el-col :span="10">
<dict-selector
clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.usedScoreOperate"
@change="handleQuery"
>
</dict-selector>
</el-col>
<el-col :span="14">
<el-input
v-model.trim="queryParams.usedScore"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="$t('会员注册时间')">
<el-date-picker
type="datetimerange"
clearable
placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</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>
</el-form-item>
</el-form>
<el-row class="mb8">
<el-button
type="success"
size="mini"
icon="el-icon-plus"
@click="handleScore"
>{{ $t("操作积分") }}</el-button
>
</el-row>
<el-table
ref="multipleTable"
v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column
width="140"
:label="$t('会员编号')"
align="center"
prop="id"
></el-table-column>
<el-table-column
:label="$t('会员名称')"
align="center"
:prop="isChinese ? 'memberNameZh' : 'memberNameEn'"
></el-table-column>
<el-table-column
width="140"
:label="$t('联系方式')"
align="center"
prop="mobile"
></el-table-column>
<el-table-column
width="140"
align="center"
:label="$t('国家')"
:prop="isChinese ? 'countryNameZh' : 'countryNameEn'"
></el-table-column>
<el-table-column
:label="$t('当前积分')"
align="center"
prop="holdScore"
></el-table-column>
<el-table-column
:label="$t('已兑换积分')"
align="center"
prop="usedScore"
></el-table-column>
<el-table-column
:label="$t('已失效积分')"
align="center"
prop="expiredScore"
></el-table-column>
<el-table-column :label="$t('会员注册时间')" align="center">
<template v-slot="{ row }">
{{ parseTime(row.createTime) || "/" }}</template
>
</el-table-column>
</el-table>
<!-- //分页列表 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="handleQueryPagination"
/>
<el-dialog
:title="$t('操作积分')"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
>
<el-form ref="form" :model="formQuery" label-width="80px">
<el-form-item :label="$t('会员')">
<el-select
v-model="formQuery.memberIds"
multiple
placeholder="请选择"
>
<el-option
v-for="item in selectedMember"
:key="item.id"
:label="isChinese ? item.memberNameZh : item.memberNameEn"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('操作')">
<el-radio-group v-model="formQuery.operateType">
<el-radio
v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)"
:key="dict.value"
:label="dict.value"
>{{ $l(dict, "label") }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('积分')">
<el-input
v-model.number="queryParams.title"
:placeholder="$t('请输入积分')"
clearable
/>
</el-form-item>
<el-form-item :label="$t('备注')"></el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleScoreSubmit">{{
$t("操作积分")
}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { getTradeCountryList, getMemberList } from "@/api/ecw/giftManagement";
export default {
name: "memberPointsSummary",
data() {
return {
selectedMember: [],
countryList: [],
cityList: [],
dateRangeCreateTime: [],
total: 0,
loading: true,
dialogVisible: false,
memberList: [],
formQuery: {
comment: "",
memberIds: [],
operateType: null,
scoreCount: null,
},
queryParams: {
country: null,
city: null,
endTime: "",
holdScore: null,
holdScoreOperate: null,
key: "",
pageNo: 1,
pageSize: 10,
startTime: "",
usedScore: null,
usedScoreOperate: null,
},
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
},
created() {
this.handleQuery();
this.getCountryList();
},
activated() {
this.handleQuery();
},
methods: {
handleScore() {
if (this.selectedMember.length > 0) {
this.dialogVisible = true;
} else {
this.$message({
message: this.$t("请先选择会员再进行操作"),
type: "warning",
});
}
},
handleScoreSubmit() {},
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
})
.catch((_) => {});
},
handleSelectionChange(val) {
this.selectedMember = val;
},
dialogBeforeClose() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
},
getCountryList() {
getTradeCountryList().then((res) => {
this.countryList = res.data;
});
},
handleQuery() {
this.queryParams.pageNo = 1;
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
handleQueryPagination() {
let params = { ...this.queryParams };
this.addBeginAndEndTime(
params,
this.dateRangeCreateTime,
"createTime",
false
);
getMemberList(params).then((res) => {
this.loading = false;
this.memberList = res.data.list;
this.total = res.data.total;
});
},
resetQuery() {
this.loading = true;
this.queryParams = {
country: null,
city: null,
endTime: null,
holdScore: null,
holdScoreOperate: null,
key: null,
pageNo: 1,
pageSize: 10,
startTime: null,
usedScore: null,
usedScoreOperate: null,
};
this.handleQuery();
},
},
};
</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