Commit b795e2ab by zhangxw

优惠券联调修改

1 parent 7efebbf9
<template>
<a-card class="tabs-card" :bordered="false" :tab-list="orderStateTabs" :active-tab-key="orderState" @tabChange="key => changeTab(key )">
<!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" @onReset="pageReset" :simpleFieldNum="4"/>
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="handlePageReload" @onReset="handlePageReset" :simpleFieldNum="4"/>
<!--查询栏end-->
<!--拍卖订单列表start-->
<div class="table-operations">
......@@ -211,6 +211,16 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
}).finally(() => this.loading = false);
}
handlePageReload() {
this.pageReload()
this.reloadTabsCount()
}
handlePageReset() {
this.pageReset()
this.reloadTabsCount()
}
/**
* 审核过户资料
*/
......
<template>
<div>
</div>
</template>
\ No newline at end of file
......@@ -2,16 +2,7 @@
<div>
<a-drawer width="936" :title="titleVisible" :maskClosable="false" :keyboard="false" placement="right"
:open="dialogVisible" @close="onClose">
<template #extra>
<a-space v-if="!isViewMode">
<a-button @click="onClose">取消</a-button>
<a-button type="primary" @click="handleOk()">创建</a-button>
</a-space>
<a-space v-else>
<a-button type="primary" @click="onClose">返回</a-button>
</a-space>
</template>
<a-spin :spinning="submitted" style="margin-top: 16px;">
<a-spin :spinning="submitted" style="margin-top: 16px;padding-bottom: 40px;">
<a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol"
ref="formRef" :disabled="isViewMode">
<title-divider title="活动基本信息"></title-divider>
......@@ -33,8 +24,8 @@
<div class="form-tip">此时间不等于用户领到券后的使用有效期,券的使用有效期由优惠券模板定义</div>
</a-form-item>
<a-form-item name="activityDesc" label="活动备注">
<a-textarea v-model:value="postData.activityDesc" show-count :maxlength="200"
<a-form-item name="remark" label="活动备注">
<a-textarea v-model:value="postData.remark" show-count :maxlength="200"
placeholder="可填写活动的背景、目的、负责人等信息,仅后台可见" :rows="4" style="width: 580px;" />
</a-form-item>
......@@ -194,6 +185,15 @@
</template>
</a-form>
</a-spin>
<div class="footer_btn">
<a-space v-if="!isViewMode">
<a-button @click="onClose">取消</a-button>
<a-button type="primary" @click="handleOk()">创建</a-button>
</a-space>
<a-space v-else>
<a-button type="primary" @click="onClose">返回</a-button>
</a-space>
</div>
</a-drawer>
</div>
</template>
......@@ -240,7 +240,7 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
activityId: "",
activityName: "",
activityRange: [],
activityDesc: "",
remark: "",
relationRemark: "",
agreementId: undefined as any,
sendNotification: 1,
......@@ -455,8 +455,10 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
responseData = {
...responseData,
activityRange: responseData.validStartTime && responseData.validEndTime ? [parseDate(responseData.validStartTime), parseDate(responseData.validEndTime)] : [],
applicableType: responseData?.targetType == 1 ? 'ALL' : responseData?.targetType == 2 ? 'ACCOUNT' : 'ACCOUNT',
applicableType: responseData?.targetType == 1 ? 'ALL' : responseData?.targetType == 2 ? 'ACCOUNT' : 'TAG',
activityName: this.pageState === "COPY" ? `${responseData.activityName}_副本` : responseData.activityName,
accountTags: responseData?.tagIds || [],
accounts: responseData?.targetAccount || []
}
}
this.postData = responseData
......@@ -570,7 +572,6 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
templateId: this.postData.templateId,
distributionQuantity: this.toNumberOrNull(this.postData.distributionQuantity),
agreementId: this.postData.agreementId,
targetType: this.postData.applicableType === "ALL" ? 1 : this.postData.applicableType === "ACCOUNT" ? 2 : 2,
sendNotification: this.postData.sendNotification,
priceRanges: this.postData.activityType === 1
? (this.postData.priceRanges || []).map((r: any) => ({
......@@ -579,7 +580,9 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
templateId: r.templateId,
}))
: [],
targetPhoneNumbers: this.postData.accounts?.map((account: any) => account.mobile) || [],
targetType: this.postData.activityType === 2 ? (this.postData.applicableType === 'ACCOUNT' ? 2 : this.postData.applicableType === 'TAG' ? 3 : 1) : '',
tagIds: this.postData.applicableType === 'TAG' ? this.postData.accountTags?.map(val => val.value) : [],
targetPhoneNumbers: this.postData.applicableType === 'ACCOUNT' ? this.postData.accounts?.map(account => account.mobile) : [],
remark: this.postData.remark,
};
......@@ -591,7 +594,7 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
this.submitted = true;
const payload = this.buildSubmitPayload()
console.log("submit payload", payload)
DiscountController[this.pageState === "EDIT" ? "updateCouponActivity" : "createCouponActivity"](this.axios, payload).then((res) => {
DiscountController[this.pageState === "EDIT" ? "updateCouponActivity" : "createCouponActivity"](this.axios, payload).then((res) => {
this.submitted = false;
let { code, message: msg } = res.data;
if (code !== '200') {
......@@ -608,10 +611,10 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
message.error(msg);
}
});
}).catch(() => {
}).catch(() => {
})
}
}
</script>
......@@ -771,5 +774,14 @@ export default class DiscountActivityAddForm extends EnhanceFormComponent<any> {
height: 280px; /* 固定内容区域高度 */
overflow-y: auto; /* 内容滚动 */
}
.footer_btn {
width: calc(100% - 16px);
background: #FFFFFF;
padding: 12px 0;
display: flex;
justify-content: end;
align-items: center;
gap: 8px;
}
</style>
......@@ -43,7 +43,9 @@
</template>
<template v-if="column.key === 'relatedActivities'">
<div v-if="record.relatedActivities && record.relatedActivities.length === 1">
<a style="text-decoration: underline;" :href="`#/discount/activity?activityId=${record.relatedActivities[0].id}`" target="_blank">{{ record.relatedActivities[0].activityName }}</a>
<a-tooltip :title="record.relatedActivities[0].activityName">
<a class="text_hide" style="text-decoration: underline;display: inline-block;width: 160px;" :href="`#/discount/activity?activityId=${record.relatedActivities[0].id}`" target="_blank">{{ record.relatedActivities[0].activityName }}</a>
</a-tooltip>
</div>
<div v-else-if="record.relatedActivities && record.relatedActivities.length > 1">
<a style="text-decoration: underline;" :href="`#/discount/activity?activityId=${record.relatedActivities[0].id}`" target="_blank">关联{{ record.relatedActivities.length }}个活动</a>
......@@ -56,6 +58,9 @@
{{deductionTypeList.find(item => item.value === record.deductionType)?.label || '-'}}
</a-tag>
</template>
<template v-if="column.key === 'totalQuantity'">
{{ (record.totalQuantity ?? '') === '' ? '不限制' : record.totalQuantity }}
</template>
<template v-if="column.key === 'remark'">
<a-tooltip :title="record.remark">
<div class="text_hide">{{ record.remark || '-' }}</div>
......@@ -67,7 +72,7 @@
{{statusList.find(item => item.value === record.status)?.label || '-'}}
</a-tag>
</template>
<template v-if="column.key === 'updateTime'">
<div>{{ record.createTime }}</div>
<div style="color: #777C85">{{ record.updateTime }}</div>
......@@ -145,7 +150,7 @@ export default class DiscountCouponPage extends PaginationComponent<Vehicle> {
{ title: '优惠券名称', dataIndex: 'templateName', key: 'templateName', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '优惠券有效期', dataIndex: "woId", key: 'woId', align: 'left', width: 200, resizable: true, ellipsis: true },
{ title: '抵扣类型', dataIndex: 'deductionType', key: 'deductionType', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '面额/最高抵扣(元)', dataIndex: 'faceAmount', key: 'faceAmount', align: 'left', width: 240, resizable: true, ellipsis: true },
{ title: '面额/最高抵扣(元)', dataIndex: 'faceAmount', key: 'faceAmount', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '关联活动数', dataIndex: 'relatedActivities', key: 'relatedActivities', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '发放总量', dataIndex: 'totalQuantity', key: 'totalQuantity', align: 'left', width: 170, resizable: true, ellipsis: true },
{ title: '备注', dataIndex: 'remark', key: 'remark', align: 'left', width: 170, resizable: true, ellipsis: true },
......
<template>
<div>
</div>
</template>
\ No newline at end of file
<template>
<div>
<a-drawer width="936" :title="titleVisible" :maskClosable="false" :keyboard="false" placement="right" :open="dialogVisible" @close="onClose">
<template #extra>
<a-space v-if="!isViewMode">
<a-button @click="onClose">取消</a-button>
<a-button type="primary" @click="handleOk()">创建</a-button>
</a-space>
<a-space v-else>
<a-button type="primary" @click="onClose">返回</a-button>
</a-space>
</template>
<a-spin :spinning="submitted" style="margin-top: 16px;">
<a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol"
ref="formRef" :disabled="isViewMode">
......@@ -121,7 +112,7 @@
@input="handleIntNativeInput('delayDays', $event)" />
</div>
</a-form-item>
<a-form-item name="validDays" class="relative-embed-item"
:rules="validDaysRules" validate-trigger="blur">
<div class="input-affix wid_184 affix-valid">
......@@ -154,8 +145,16 @@
</a-form-item>
</a-form>
</a-spin>
<div class="footer_btn">
<a-space v-if="!isViewMode">
<a-button @click="onClose">取消</a-button>
<a-button type="primary" @click="handleOk()">创建</a-button>
</a-space>
<a-space v-else>
<a-button type="primary" @click="onClose">返回</a-button>
</a-space>
</div>
</a-drawer>
</div>
</template>
......@@ -915,4 +914,13 @@ export default class CouponAddForm extends EnhanceFormComponent<any> {
:deep(.relative-embed-item .ant-form-item-explain) {
min-height: 22px;
}
.footer_btn {
width: calc(100% - 16px);
background: #FFFFFF;
padding: 12px 0;
display: flex;
justify-content: end;
align-items: center;
gap: 8px;
}
</style>
<template>
<a-card class="tabs-card" :bordered="false" :tab-list="vehicleStateTabs" :active-tab-key="vehicleStateIndex" @tabChange="key => changeTab(key )">
<!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" @onReset="pageReset" :simpleFieldNum="4"/>
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="handlePageReload" @onReset="handleReset" :simpleFieldNum="4"/>
<!--查询栏end-->
<!--库存车辆列表start-->
<div class="table-operations">
......@@ -301,6 +301,18 @@ export default class VehiclePage extends PaginationComponent<Vehicle> {
}).finally(() => this.loading = false);
}
//查询
handlePageReload() {
this.pageReload();
this.loadVehicleCount()
}
//重置查询条件
handleReset() {
this.pageReset();
this.loadVehicleCount()
}
loadVehicleCount() {
VehicleController.getVehicleCountByState(this.axios).then(res => {
this.vehicleCount = res.data;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!