Commit 1b441296660d9d194104697572f3a769359eff80

Authored by
1 parent 00f8a2a9

feat: 新增未完成状态,跟单评分,包装提成金额

src/views/project/approve/ProduceFieldPanel.vue
... ... @@ -40,7 +40,8 @@
40 40 import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve';
41 41 import { COLUMNS } from '../finance/financeProfit/ServiceProfit/PackageProfit/data';
42 42 import { getAuditApply, getApplyList } from '/@/api/project/invoice';
43   - import { EDIT_INFO } from '../finance/financeProfit/ProductProfit/InnerData/tableData';
  43 + // import { EDIT_INFO } from '../finance/financeProfit/ProductProfit/InnerData/tableData';
  44 + import { APPLY_INFO } from '../finance/financeProfit/ProductProfit/InnerData/tableData';
44 45 import { find, isEmpty } from 'lodash-es';
45 46 import { ROLE } from '../order//type.d';
46 47 import { useUserStoreWithOut } from '/@/store/modules/user';
... ... @@ -159,7 +160,7 @@
159 160 !isEmpty(data.fieldInfos.costInfolockFieldVO) &&
160 161 Object.entries(data.fieldInfos.costInfolockFieldVO)?.map(([key, value]) => {
161 162 if (value === 'UN_LOCKED') {
162   - const obj = find(EDIT_INFO, { field: key });
  163 + const obj = find(APPLY_INFO, { field: key });
163 164 fieldInfos.value.baseFields.push(obj?.label);
164 165 }
165 166 });
... ...
src/views/project/config/costCreate.vue
... ... @@ -30,6 +30,10 @@
30 30 <a-input v-model:value="spainRatio" />
31 31 </div>
32 32 <div
  33 + ><span style="margin-right: 8px; width: 80%">包装提成金额</span>
  34 + <a-input v-model:value="copyCommission" />
  35 + </div>
  36 + <div
33 37 ><span style="margin-right: 8px; width: 80%">年份:</span>
34 38 <a-select v-model:value="year" style="width: 100%">
35 39 <a-select-option v-for="y in yearOptions" :key="y" :value="y">{{ y }}</a-select-option>
... ... @@ -70,6 +74,7 @@
70 74 const fixCost = ref();
71 75 const ratio = ref();
72 76 const spainRatio = ref();
  77 + const copyCommission = ref();
73 78 const price = ref();
74 79 const year = ref(new Date().getFullYear().toString());
75 80 // Generate year options from 2023 to current year
... ... @@ -96,6 +101,11 @@
96 101 relationName: '西班牙提成比例',
97 102 relationValue: '',
98 103 },
  104 + {
  105 + relationCode: 'copyCommission',
  106 + relationName: '包装提成金额',
  107 + relationValue: '',
  108 + },
99 109 // {
100 110 // relationCode: 'price',
101 111 // relationName: '生产提成单价',
... ... @@ -104,10 +114,22 @@
104 114 ]);
105 115 const { customerCode: customerCodeOptions } = useOrderInfo(orderStore);
106 116  
107   - function handleShow(visible: boolean) {
  117 + function handleShow(visible) {
108 118 if (visible) {
  119 + // 重置表单字段
  120 + fixCost.value = '';
  121 + ratio.value = '';
  122 + spainRatio.value = '';
  123 + copyCommission.value = '';
  124 + customerCode.value = undefined;
  125 + year.value = new Date().getFullYear().toString();
  126 + relationValue.value = [
  127 + { relationCode: 'fixCost', relationName: '固定成本', relationValue: '' },
  128 + { relationCode: 'ratio', relationName: '提成比例', relationValue: '' },
  129 + { relationCode: 'spainRatio', relationName: '西班牙提成比例', relationValue: '' },
  130 + { relationCode: 'copyCommission', relationName: '包装提成金额', relationValue: '' },
  131 + ];
109 132 loading.value = true;
110   - // setModalProps({ loading: true, confirmLoading: true });
111 133 setModalProps({ loading: false, confirmLoading: false });
112 134 }
113 135 }
... ... @@ -129,6 +151,7 @@
129 151 relationValue.value[0].relationValue = fixCost.value;
130 152 relationValue.value[1].relationValue = formatPercentage(ratio.value);
131 153 relationValue.value[2].relationValue = formatPercentage(spainRatio.value);
  154 + relationValue.value[3].relationValue = copyCommission.value;
132 155 await addConfig({
133 156 settingCode: 'customerCode',
134 157 settingName: '客户提成成本配置',
... ... @@ -153,6 +176,7 @@
153 176 fixCost,
154 177 ratio,
155 178 spainRatio,
  179 + copyCommission,
156 180 price,
157 181 customerCode,
158 182 year,
... ...
src/views/project/config/costEdit.vue
... ... @@ -18,6 +18,7 @@
18 18 <a-input v-model:value="fixCost" addonBefore="固定成本 " />
19 19 <a-input v-model:value="ratio" addonBefore="提成比例 " />
20 20 <a-input v-model:value="spainRatio" addonBefore="西班牙提成比例 " />
  21 + <a-input v-model:value="copyCommission" addonBefore="包装提成金额 " />
21 22 <a-input v-model:value="year" :disabled="true" addonBefore="年份 " />
22 23 <!-- <a-input v-model:value="price" addonBefore="生产提成单价" /> -->
23 24 </a-space>
... ... @@ -41,6 +42,7 @@
41 42 spainRatio.value = relationValue.value[2].relationValue
42 43 ? (parseFloat(relationValue.value[2].relationValue) * 100).toFixed(2) + '%'
43 44 : '';
  45 + copyCommission.value = relationValue.value[3].relationValue;
44 46 year.value = listAll.value.relationName;
45 47 });
46 48 //获取现有的列表
... ... @@ -48,6 +50,7 @@
48 50 const fixCost = ref();
49 51 const ratio = ref();
50 52 const spainRatio = ref();
  53 + const copyCommission = ref('');
51 54 const relationValue = ref();
52 55 const year = ref();
53 56  
... ... @@ -65,9 +68,16 @@
65 68  
66 69 //完成编辑
67 70 async function handleSubmit() {
68   - relationValue.value[0].relationValue = fixCost.value;
69   - relationValue.value[1].relationValue = formatPercentage(ratio.value);
70   - relationValue.value[2].relationValue = formatPercentage(spainRatio.value);
  71 + // relationValue.value[0].relationValue = fixCost.value;
  72 + // relationValue.value[1].relationValue = formatPercentage(ratio.value);
  73 + // relationValue.value[2].relationValue = formatPercentage(spainRatio.value);
  74 + // relationValue.value[3].relationValue = copyCommission.value;
  75 + relationValue.value = [
  76 + { relationCode: 'fixCost', relationName: '固定成本', relationValue: fixCost.value },
  77 + { relationCode: 'ratio', relationName: '提成比例', relationValue: formatPercentage(ratio.value) },
  78 + { relationCode: 'spainRatio', relationName: '西班牙提成比例', relationValue: formatPercentage(spainRatio.value) },
  79 + { relationCode: 'commission', relationName: '提成', relationValue: copyCommission.value },
  80 + ];
71 81 await saveConfig({
72 82 id: listAll.value.id,
73 83 settingCode: 'customerCode',
... ...
src/views/project/config/data.tsx
... ... @@ -98,6 +98,15 @@ export const COLUMNS = {
98 98 return (value[2]?.relationValue * 100).toFixed(2) + '%';
99 99 },
100 100 },
  101 + {
  102 + title: '包装提成金额',
  103 + dataIndex: 'relationValue',
  104 + width: 150,
  105 + customRender: (column) => {
  106 + const value = JSON.parse(column.record.relationValue);
  107 + return value[3]?value[3].relationValue:'';
  108 + },
  109 + },
101 110 // {
102 111 // title: '生产提成单价',
103 112 // dataIndex: 'relationValue',
... ...
src/views/project/finance/financeProfit/ProductProfit/InnerData/data.tsx
... ... @@ -85,7 +85,10 @@ export const searchFormSchema = [
85 85 colProps: { span: 8 },
86 86  
87 87 componentProps: {
88   - options: [{
  88 + options: [ {
  89 + label: '未完成',
  90 + value: -1,
  91 + },{
89 92 label: '待审核',
90 93 value: 0,
91 94 }, {
... ...
src/views/project/finance/financeProfit/ProductProfit/InnerData/tableData.tsx
... ... @@ -73,4 +73,40 @@ export const EDIT_INFO = [
73 73 rules: [{ required: true }],
74 74 },
75 75 ];
76   -
  76 +export const APPLY_INFO = [
  77 + {
  78 + field: 'packetActualRmbTotalPrice',
  79 + component: 'Select',
  80 + labelWidth: 150,
  81 + label: '包装费用实际金额¥',
  82 + rules: [{ required: true }],
  83 + },
  84 + {
  85 + field: 'orderScore',
  86 + component: 'Select',
  87 + labelWidth: 150,
  88 + label: '跟单评分',
  89 + rules: [{ required: true }],
  90 + },
  91 + {
  92 + field: 'productionDepartmentPredictPrice',
  93 + component: 'Select',
  94 + labelWidth: 180,
  95 + label: '生产科预算金额',
  96 + rules: [{ required: true }],
  97 + },
  98 + {
  99 + field: 'productionActualPrice',
  100 + component: 'Select',
  101 + labelWidth: 150,
  102 + label: '实际发生费用',
  103 + rules: [{ required: true }],
  104 + },
  105 + {
  106 + field: 'productionDepartmentPredictUnitPrice',
  107 + component: 'Select',
  108 + labelWidth: 150,
  109 + label: '生产科预算单价',
  110 + rules: [{ required: true }],
  111 + },
  112 +];
... ...
src/views/project/finance/financeProfit/ProductProfit/InnerProduce/data.tsx
... ... @@ -89,7 +89,10 @@ export const searchFormSchema = [
89 89 colProps: { span: 8 },
90 90  
91 91 componentProps: {
92   - options: [{
  92 + options: [ {
  93 + label: '未完成',
  94 + value: -1,
  95 + },{
93 96 label: '待审核',
94 97 value: 0,
95 98 }, {
... ...
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/ApproveReason.vue
... ... @@ -31,6 +31,7 @@
31 31 await getPackageApplyEdit({
32 32 orderId: baseFieldValues.value.orderId,
33 33 packetActualRmbTotalPrice: baseFieldValues.value.packetActualRmbTotalPrice,
  34 + orderScore: baseFieldValues.value.orderScore,
34 35 applyRemark: baseFieldValues.value.applyRemark,
35 36 type: 80,
36 37 });
... ...
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/CheckDetail.vue
... ... @@ -38,8 +38,8 @@
38 38 import { useUserStoreWithOut } from '/@/store/modules/user';
39 39  
40 40 const userStore = useUserStoreWithOut();
41   - const getSchema = (fields) =>
42   - fields
  41 + const getSchema = (fields) => {
  42 + const result = fields
43 43 .map((item) => ({
44 44 field: `${item.field}`,
45 45 dataIndex: `${item.field}`,
... ... @@ -58,6 +58,8 @@
58 58 // item.field !== 'packetPrice' &&
59 59 item.field !== 'exchangeRate' && item.field !== 'profitRate',
60 60 );
  61 + return result;
  62 + };
61 63  
62 64 export default defineComponent({
63 65 components: { BasicDrawer, BasicForm, ApproveReason },
... ...
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/FinanceEdit.vue
... ... @@ -23,6 +23,14 @@
23 23 auto-size
24 24 />
25 25 <div style="margin: 16px 0"></div>
  26 + <div style="font-size: 15px">跟单评分</div>
  27 + <a-input
  28 + v-model:value="input2"
  29 + placeholder="请输入"
  30 + :disabled="status_score === 'LOCKED'"
  31 + auto-size
  32 + />
  33 + <div style="margin: 16px 0"></div>
26 34  
27 35 <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> -->
28 36 <template #appendFooter>
... ... @@ -116,16 +124,19 @@
116 124  
117 125 const update = ref();
118 126 const status = ref();
119   -
  127 + const status_score = ref();
120 128 const input1 = ref();
  129 + const input2 = ref();
121 130 const id = ref();
122 131 const [register, { setDrawerProps, closeDrawer }] = useDrawerInner((data) => {
123 132 // 方式1
124 133 if (data.data.lockFields) {
125 134 status.value = data.data.lockFields?.packetActualRmbTotalPrice;
  135 + status_score.value = data.data.lockFields?.orderScore;
126 136 }
127 137 id.value = data.data.orderId;
128 138 input1.value = data.data?.packetActualRmbTotalPrice;
  139 + input2.value = data.data?.orderScore;
129 140 resetFields();
130 141 setDrawerProps({ confirmLoading: false });
131 142 setFieldsValue({
... ... @@ -142,12 +153,20 @@
142 153 // bgUrl: update.value.data.bgUrl,
143 154 // };
144 155 if (!input1.value) {
145   - error('选项不能为空');
146   - } else {
147   - await getPackageEdit({
148   - orderId: id.value,
149   - packetActualRmbTotalPrice: input1.value,
150   - });
  156 + error('包装费用实际金额不能为空');
  157 + } else{
  158 + if(!input2.value){
  159 + await getPackageEdit({
  160 + orderId: id.value,
  161 + packetActualRmbTotalPrice: input1.value,
  162 + });
  163 + }else{
  164 + await getPackageEdit({
  165 + orderId: id.value,
  166 + packetActualRmbTotalPrice: input1.value,
  167 + orderScore: Number(input2.value),
  168 + });
  169 + }
151 170 emit('success');
152 171 closeDrawer();
153 172 }
... ...
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/data.tsx
... ... @@ -85,7 +85,10 @@ export const searchFormSchema = [
85 85 colProps: { span: 8 },
86 86  
87 87 componentProps: {
88   - options: [{
  88 + options: [ {
  89 + label: '未完成',
  90 + value: -1,
  91 + },{
89 92 label: '待审核',
90 93 value: 0,
91 94 }, {
... ... @@ -209,6 +212,22 @@ export const COLUMNS = [
209 212 },
210 213 },
211 214 {
  215 + title: '跟单评分',
  216 + dataIndex: 'orderScore',
  217 + width: 120,
  218 + customRender: (column) => {
  219 + return column.record?.orderScore?.toFixed(2);
  220 + },
  221 + },
  222 + {
  223 + title: '提成金额',
  224 + dataIndex: 'copyCommission',
  225 + width: 120,
  226 + customRender: (column) => {
  227 + return column.record?.copyCommission?.toFixed(2);
  228 + },
  229 + },
  230 + {
212 231 title: '状态',
213 232 dataIndex: 'status',
214 233 width: 120,
... ...
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/tableData.tsx
... ... @@ -27,5 +27,12 @@ export const FIELDS_BASE_INFO = [
27 27 label: '包装费用实际金额¥',
28 28 rules: [{ required: true }],
29 29 },
  30 + {
  31 + field: 'orderScore',
  32 + component: 'Select',
  33 + labelWidth: 150,
  34 + label: '跟单评分',
  35 + rules: [{ required: true }],
  36 + },
30 37 ];
31 38  
... ...
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/data.tsx
... ... @@ -81,7 +81,10 @@ export const searchFormSchema = [
81 81 colProps: { span: 8 },
82 82  
83 83 componentProps: {
84   - options: [{
  84 + options: [ {
  85 + label: '未完成',
  86 + value: -1,
  87 + },{
85 88 label: '待审核',
86 89 value: 0,
87 90 }, {
... ...