|
@@ -19,12 +19,18 @@
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { remarkschemas, Addschemas } from "./data";
|
|
|
+ import { remarkschemas, Addschemas } from './data';
|
|
|
import { InvoiceRegister } from '/@/api/order';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { uploadApi } from '/@/api/product/index';
|
|
|
import { ResultEnum } from '/@/enums/httpEnum';
|
|
|
- import { DetailsApi, dincrementList, AddUserIncrementApi, getAddUserIncrementTime, currencyList } from '/@/api/account';
|
|
|
+ import {
|
|
|
+ DetailsApi,
|
|
|
+ dincrementList,
|
|
|
+ AddUserIncrementApi,
|
|
|
+ getAddUserIncrementTime,
|
|
|
+ currencyList,
|
|
|
+ } from '/@/api/account';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { otherInfoStore } from '/@/store/modules/other';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
@@ -41,7 +47,7 @@
|
|
|
const userStore = useUserStore();
|
|
|
const overviewInfo = computed(() => otherInfo.getOverviewInfo);
|
|
|
// const overviewInfo = getOverviewInfo() || {}
|
|
|
- const title = ref('新增权益')
|
|
|
+ const title = ref('新增权益');
|
|
|
const fileFlow = reactive({
|
|
|
file: null,
|
|
|
id: '',
|
|
@@ -66,6 +72,9 @@
|
|
|
component: 'ApiSelect',
|
|
|
label: '权益类型',
|
|
|
required: true,
|
|
|
+ itemProps: {
|
|
|
+ autoLink: false,
|
|
|
+ },
|
|
|
componentProps: {
|
|
|
api: async function () {
|
|
|
const res = await dincrementList();
|
|
@@ -82,17 +91,26 @@
|
|
|
},
|
|
|
onChange: (value) => {
|
|
|
console.log('onChange', value);
|
|
|
- let { monthQy = 1, count = 1 } = getFieldsValue()
|
|
|
+ let { monthQy = 1, count = 1 } = getFieldsValue();
|
|
|
let unitStr = value == '3' ? '个月' : '年';
|
|
|
- let incrementEndTime = dayjs().add(1, value == '3' ? 'month' : 'year').format('YYYY-MM-DD')
|
|
|
+ let incrementEndTime = dayjs()
|
|
|
+ .add(1, value == '3' ? 'month' : 'year')
|
|
|
+ .format('YYYY-MM-DD');
|
|
|
updateSchema([
|
|
|
- { field: 'monthQy', ifShow: true, componentProps: { options: showOptions( value == '3' ? 12 : 5), } },
|
|
|
- { field: 'count', suffix: ( count * monthQy ) + unitStr },
|
|
|
- { field: 'incrementEndTime', componentProps: {
|
|
|
- // disabledDate: (current) => {
|
|
|
- // return current && current < dayjs().subtract(1, 'day').add(1, value == '3' ? 'month' : 'year');
|
|
|
- // },
|
|
|
- } }
|
|
|
+ {
|
|
|
+ field: 'monthQy',
|
|
|
+ ifShow: true,
|
|
|
+ componentProps: { options: showOptions(value == '3' ? 12 : 5) },
|
|
|
+ },
|
|
|
+ { field: 'count', suffix: count * monthQy + unitStr },
|
|
|
+ {
|
|
|
+ field: 'incrementEndTime',
|
|
|
+ componentProps: {
|
|
|
+ // disabledDate: (current) => {
|
|
|
+ // return current && current < dayjs().subtract(1, 'day').add(1, value == '3' ? 'month' : 'year');
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ },
|
|
|
]);
|
|
|
setFieldsValue({
|
|
|
monthQy: 1,
|
|
@@ -139,7 +157,7 @@
|
|
|
let { incrementTypeId, count = 1 } = getFieldsValue();
|
|
|
let unit = incrementTypeId == '3' ? 'month' : 'year';
|
|
|
let unitStr = incrementTypeId == '3' ? '个月' : '年';
|
|
|
- updateSchema({ field: 'count', suffix: ( count * data ) + unitStr });
|
|
|
+ updateSchema({ field: 'count', suffix: count * data + unitStr });
|
|
|
setFieldsValue({
|
|
|
incrementEndTime: dayjs().add(data, unit).format('YYYY-MM-DD'),
|
|
|
});
|
|
@@ -160,7 +178,7 @@
|
|
|
onChange: (data = 1) => {
|
|
|
let { incrementTypeId, monthQy = 1 } = getFieldsValue();
|
|
|
let unit = incrementTypeId == '3' ? '个月' : '年';
|
|
|
- updateSchema({ field: 'count', suffix: ( monthQy * data ) + unit });
|
|
|
+ updateSchema({ field: 'count', suffix: monthQy * data + unit });
|
|
|
},
|
|
|
},
|
|
|
colProps: {
|
|
@@ -196,7 +214,7 @@
|
|
|
componentProps: {
|
|
|
precision: 2,
|
|
|
min: 0,
|
|
|
- step: 1
|
|
|
+ step: 1,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -219,7 +237,10 @@
|
|
|
},
|
|
|
];
|
|
|
|
|
|
- const [registerForm, { validate, getFieldsValue, resetFields, setFieldsValue, updateSchema }] = useForm({
|
|
|
+ const [
|
|
|
+ registerForm,
|
|
|
+ { validate, getFieldsValue, resetFields, setFieldsValue, updateSchema },
|
|
|
+ ] = useForm({
|
|
|
labelWidth: 120,
|
|
|
schemas: [...Addschemas, ...schemas, ...remarkschemas],
|
|
|
showActionButtonGroup: false,
|
|
@@ -236,7 +257,16 @@
|
|
|
field: 'useType',
|
|
|
componentProps: {
|
|
|
onChange: (value) => {
|
|
|
- updateSchema({ field: 'projectNum', ifShow: value == '4' });
|
|
|
+ updateSchema([
|
|
|
+ { field: 'projectNum', ifShow: value == '4' },
|
|
|
+ { field: 'companyName', ifShow: value != '3' },
|
|
|
+ { field: 'businessDept', ifShow: value != '3' },
|
|
|
+ { field: 'businessName', ifShow: value != '3' },
|
|
|
+ { field: 'customerPayTime', ifShow: value != '3' },
|
|
|
+ { field: 'customerName', ifShow: value != '3' },
|
|
|
+ { field: 'customerType', ifShow: value != '3' },
|
|
|
+ { field: 'endCustomer', ifShow: value != '3' },
|
|
|
+ ]);
|
|
|
},
|
|
|
},
|
|
|
},
|
|
@@ -269,7 +299,7 @@
|
|
|
});
|
|
|
async function onDataReceive(data) {
|
|
|
let incrementEndTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
- if( data.incrementTypeId ){
|
|
|
+ if (data.incrementTypeId) {
|
|
|
const res = await getAddUserIncrementTime({
|
|
|
id: data.id,
|
|
|
userId: data.userId,
|
|
@@ -287,17 +317,17 @@
|
|
|
// incrementEndTime: dayjs(incrementEndTime).add(1, data.incrementTypeId == '3' ? 'month' : 'year').format('YYYY-MM-DD'),
|
|
|
});
|
|
|
}
|
|
|
- function showOptions(type = 5){
|
|
|
- let uint = type == 5 ? '年' : '个月'
|
|
|
- let arr = []
|
|
|
+ function showOptions(type = 5) {
|
|
|
+ let uint = type == 5 ? '年' : '个月';
|
|
|
+ let arr = [];
|
|
|
for (let index = 0; index < type; index++) {
|
|
|
arr.push({
|
|
|
- label: (index+1) + uint,
|
|
|
- value: index+1,
|
|
|
- key: index+1,
|
|
|
+ label: index + 1 + uint,
|
|
|
+ value: index + 1,
|
|
|
+ key: index + 1,
|
|
|
});
|
|
|
}
|
|
|
- return arr || []
|
|
|
+ return arr || [];
|
|
|
}
|
|
|
async function handleConfirm() {
|
|
|
await validate();
|