Commit f13748555a5bd73266346cc550fb4552a2ccd3f7

Authored by
2 parents da5aa962 3a52b75d

Merge branch 'zwl-develop' into 'develop'

feat: 新增提成字段和设置为已发提成按钮



See merge request !20
src/api/project/invoice.ts
@@ -562,3 +562,10 @@ export const setInnerProfitSetStatus = async (params: any) => { @@ -562,3 +562,10 @@ export const setInnerProfitSetStatus = async (params: any) => {
562 params, 562 params,
563 }); 563 });
564 }; 564 };
  565 +
  566 +export const setCommissionStatus = async (data: { orderIds: number[] }) => {
  567 + return await defHttp.post<any>({
  568 + url: '/order/cost/setCommissionStatus',
  569 + data,
  570 + });
  571 +};
src/views/project/finance/financeProfit/ProductProfit/InnerData/tableData.tsx
@@ -89,6 +89,13 @@ export const APPLY_INFO = [ @@ -89,6 +89,13 @@ export const APPLY_INFO = [
89 rules: [{ required: true }], 89 rules: [{ required: true }],
90 }, 90 },
91 { 91 {
  92 + field: 'issuedCommission',
  93 + component: 'Select',
  94 + labelWidth: 150,
  95 + label: '已发提成',
  96 + rules: [{ required: true }],
  97 + },
  98 + {
92 field: 'productionDepartmentPredictPrice', 99 field: 'productionDepartmentPredictPrice',
93 component: 'Select', 100 component: 'Select',
94 labelWidth: 180, 101 labelWidth: 180,
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/ApproveReason.vue
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 orderId: baseFieldValues.value.orderId, 32 orderId: baseFieldValues.value.orderId,
33 packetActualRmbTotalPrice: baseFieldValues.value.packetActualRmbTotalPrice, 33 packetActualRmbTotalPrice: baseFieldValues.value.packetActualRmbTotalPrice,
34 orderScore: baseFieldValues.value.orderScore, 34 orderScore: baseFieldValues.value.orderScore,
  35 + issuedCommission: baseFieldValues.value.issuedCommission,
35 applyRemark: baseFieldValues.value.applyRemark, 36 applyRemark: baseFieldValues.value.applyRemark,
36 type: 80, 37 type: 80,
37 }); 38 });
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/FinanceEdit.vue
@@ -31,6 +31,14 @@ @@ -31,6 +31,14 @@
31 auto-size 31 auto-size
32 /> 32 />
33 <div style="margin: 16px 0"></div> 33 <div style="margin: 16px 0"></div>
  34 + <div style="font-size: 15px">已发提成</div>
  35 + <a-input
  36 + v-model:value="input_issuedCommission"
  37 + placeholder="请输入"
  38 + :disabled="status_issuedCommission === 'LOCKED'"
  39 + auto-size
  40 + />
  41 + <div style="margin: 16px 0"></div>
34 42
35 <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> 43 <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> -->
36 <template #appendFooter> 44 <template #appendFooter>
@@ -125,8 +133,10 @@ @@ -125,8 +133,10 @@
125 const update = ref(); 133 const update = ref();
126 const status = ref(); 134 const status = ref();
127 const status_score = ref(); 135 const status_score = ref();
  136 + const status_issuedCommission = ref();
128 const input1 = ref(); 137 const input1 = ref();
129 const input2 = ref(); 138 const input2 = ref();
  139 + const input_issuedCommission = ref();
130 const id = ref(); 140 const id = ref();
131 const loading = ref(false); 141 const loading = ref(false);
132 const [register, { setDrawerProps, closeDrawer }] = useDrawerInner((data) => { 142 const [register, { setDrawerProps, closeDrawer }] = useDrawerInner((data) => {
@@ -134,10 +144,12 @@ @@ -134,10 +144,12 @@
134 if (data.data.lockFields) { 144 if (data.data.lockFields) {
135 status.value = data.data.lockFields?.packetActualRmbTotalPrice; 145 status.value = data.data.lockFields?.packetActualRmbTotalPrice;
136 status_score.value = data.data.lockFields?.orderScore; 146 status_score.value = data.data.lockFields?.orderScore;
  147 + status_issuedCommission.value = data.data.lockFields?.issuedCommission;
137 } 148 }
138 id.value = data.data.orderId; 149 id.value = data.data.orderId;
139 input1.value = data.data?.packetActualRmbTotalPrice; 150 input1.value = data.data?.packetActualRmbTotalPrice;
140 input2.value = data.data?.orderScore; 151 input2.value = data.data?.orderScore;
  152 + input_issuedCommission.value = data.data?.issuedCommission;
141 resetFields(); 153 resetFields();
142 setDrawerProps({ confirmLoading: false }); 154 setDrawerProps({ confirmLoading: false });
143 setFieldsValue({ 155 setFieldsValue({
@@ -156,7 +168,7 @@ @@ -156,7 +168,7 @@
156 setDrawerProps({ confirmLoading: false }); 168 setDrawerProps({ confirmLoading: false });
157 } else { 169 } else {
158 try { 170 try {
159 - if (!input2.value) { 171 + if (!input2.value && !input_issuedCommission.value) {
160 await getPackageEdit({ 172 await getPackageEdit({
161 orderId: id.value, 173 orderId: id.value,
162 packetActualRmbTotalPrice: input1.value, 174 packetActualRmbTotalPrice: input1.value,
@@ -166,6 +178,7 @@ @@ -166,6 +178,7 @@
166 orderId: id.value, 178 orderId: id.value,
167 packetActualRmbTotalPrice: input1.value, 179 packetActualRmbTotalPrice: input1.value,
168 orderScore: Number(input2.value), 180 orderScore: Number(input2.value),
  181 + issuedCommission: Number(input_issuedCommission.value),
169 }); 182 });
170 } 183 }
171 emit('success'); 184 emit('success');
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/data.tsx
@@ -97,6 +97,22 @@ export const searchFormSchema = [ @@ -97,6 +97,22 @@ export const searchFormSchema = [
97 }], 97 }],
98 }, 98 },
99 }, 99 },
  100 + {
  101 + field: 'orderCommissionStatus',
  102 + label: '提成发放状态',
  103 + component: 'Select',
  104 + colProps: { span: 8 },
  105 +
  106 + componentProps: {
  107 + options: [ {
  108 + label: '未发放',
  109 + value: -1,
  110 + },{
  111 + label: '已发放',
  112 + value: 0,
  113 + }],
  114 + },
  115 + },
100 ] 116 ]
101 // export const COLUMNS = [ 117 // export const COLUMNS = [
102 // { 118 // {
@@ -228,6 +244,26 @@ export const COLUMNS = [ @@ -228,6 +244,26 @@ export const COLUMNS = [
228 }, 244 },
229 }, 245 },
230 { 246 {
  247 + title: '已发提成',
  248 + dataIndex: 'issuedCommission',
  249 + width: 120,
  250 + customRender: (column) => {
  251 + return column.record?.issuedCommission?.toFixed(2);
  252 + },
  253 + },
  254 + {
  255 + title: '提成发放状态',
  256 + dataIndex: 'orderCommissionStatus',
  257 + width: 120,
  258 + customRender: (column) => {
  259 + if (column.record?.orderCommissionStatus === null || column.record?.orderCommissionStatus === -1) {
  260 + return '未发放';
  261 + } else if (column.record?.orderCommissionStatus === 0) {
  262 + return '已发放';
  263 + }
  264 + },
  265 + },
  266 + {
231 title: '状态', 267 title: '状态',
232 dataIndex: 'status', 268 dataIndex: 'status',
233 width: 120, 269 width: 120,
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/index.vue
@@ -42,6 +42,7 @@ @@ -42,6 +42,7 @@
42 </template> --> 42 </template> -->
43 </template> 43 </template>
44 <template #toolbar> 44 <template #toolbar>
  45 +
45 <a-button 46 <a-button
46 type="primary" 47 type="primary"
47 @click="handleExport" 48 @click="handleExport"
@@ -54,6 +55,14 @@ @@ -54,6 +55,14 @@
54 @click="handleAllProjectNoQuery" 55 @click="handleAllProjectNoQuery"
55 style="margin-left: 8px;position: fixed;right: 29%;top: 107.5px;" 56 style="margin-left: 8px;position: fixed;right: 29%;top: 107.5px;"
56 >全选</a-button> 57 >全选</a-button>
  58 + <a-button
  59 + type="primary"
  60 + @click="handleSetCommissionStatus"
  61 + v-if="role == ROLE.ADMIN || role == ROLE.FINANCE"
  62 + :style="{ borderRadius: '5px 5px 5px 5px' }"
  63 + >
  64 + 设置为已发提成
  65 + </a-button>
57 </template> 66 </template>
58 </BasicTable> 67 </BasicTable>
59 <!-- <BasicModal 68 <!-- <BasicModal
@@ -75,7 +84,7 @@ @@ -75,7 +84,7 @@
75 </template> 84 </template>
76 <script setup lang="ts"> 85 <script setup lang="ts">
77 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 86 import { BasicTable, useTable, TableAction } from '/@/components/Table';
78 - import { getPackageProfit, setPackStatus } from '@/api/project/invoice'; 87 + import { getPackageProfit, setPackStatus, setCommissionStatus } from '@/api/project/invoice';
79 import { searchFormSchema, COLUMNS, allProjectNoOptions } from './data'; 88 import { searchFormSchema, COLUMNS, allProjectNoOptions } from './data';
80 import { BasicModal, useModal } from '/@/components/Modal'; 89 import { BasicModal, useModal } from '/@/components/Modal';
81 import { useMessage } from '/@/hooks/web/useMessage'; 90 import { useMessage } from '/@/hooks/web/useMessage';
@@ -568,6 +577,21 @@ @@ -568,6 +577,21 @@
568 } 577 }
569 } 578 }
570 579
  580 + const handleSetCommissionStatus = async () => {
  581 + if (!orderIds.value.length) {
  582 + createMessage.warning('请先选择要设置的订单');
  583 + return;
  584 + }
  585 + try {
  586 + await setCommissionStatus({ orderIds: orderIds.value });
  587 + createMessage.success('设置成功');
  588 + handleClearChoose();
  589 + reload();
  590 + } catch (e) {
  591 + createMessage.error('设置失败');
  592 + }
  593 + };
  594 +
571 // 监听表单字段变化 595 // 监听表单字段变化
572 function handleFieldValueChange(field: string, value: any) { 596 function handleFieldValueChange(field: string, value: any) {
573 // 如果是项目号字段变化且处于全选状态,同步更新查询条件 597 // 如果是项目号字段变化且处于全选状态,同步更新查询条件
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/tableData.tsx
@@ -34,5 +34,12 @@ export const FIELDS_BASE_INFO = [ @@ -34,5 +34,12 @@ export const FIELDS_BASE_INFO = [
34 label: '跟单评分', 34 label: '跟单评分',
35 rules: [{ required: true }], 35 rules: [{ required: true }],
36 }, 36 },
  37 + {
  38 + field: 'issuedCommission',
  39 + component: 'Select',
  40 + labelWidth: 150,
  41 + label: '已发提成',
  42 + rules: [{ required: true }],
  43 + },
37 ]; 44 ];
38 45