@@ -493,6 +494,37 @@ const formRef = ref() // 表单 Ref
/** 子表的表单 */
const subTabsName = ref('quotationProduct')
const quotationProductFormRef = ref()
+watch(
+ () => formData.value.products,
+ (newProducts) => {
+ if (!Array.isArray(newProducts)) {
+ console.warn('formData.value.products is not an array');
+ return;
+ }
+
+ let totalOnlinePrice = 0;
+ let totalOfflinePrice = 0;
+
+ for (const product of newProducts) {
+ if (typeof product.onlinePrice) {
+ totalOnlinePrice += Number(product.onlinePrice);
+ }
+ if (typeof product.offlinePrice) {
+ totalOfflinePrice += Number(product.offlinePrice);
+ }
+ }
+ formData.value.onlinePrice = totalOnlinePrice.toFixed(2)
+ formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
+ let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice
+ formData.value.totalPrice = all.toFixed(2)
+ },
+ { deep: true }
+);
+
+const setSuccess = (val) => {
+ formData.value.products = val
+}
+
const onBusinessChange = async (businessId: string) => {
if (!businessId) return
@@ -512,7 +544,6 @@ const onBusinessChange = async (businessId: string) => {
formData.value.onlinePrice = res.onlinePrice;
formData.value.totalPrice = res.totalPrice;
formData.value.creditAmount = res.creditAmount;
- console.log('%csrc/views/crm/quotation/QuotationForm.vue:516 (formData.value.creditAmount || 0) + (formData.value.creditLimitNum || 0)', 'color: #007acc;', (formData.value.creditAmount || 0) , (formData.value.creditLimitNum || 0));
// 🔁 自动加载客户详情
await onCustomerChange(res.customerId);
diff --git a/src/views/crm/quotation/components/QuotationProductDetail.vue b/src/views/crm/quotation/components/QuotationProductDetail.vue
index 3c3e3aa65..4cfdeabe1 100644
--- a/src/views/crm/quotation/components/QuotationProductDetail.vue
+++ b/src/views/crm/quotation/components/QuotationProductDetail.vue
@@ -41,6 +41,11 @@
{{row.offlinePrice}}
+
+
+
+ {{row.downlinePrice}}
+
@@ -111,8 +116,16 @@ watch(
return;
}
nextTick(() => {
+ // 循环处理
+ val.forEach((item) => {
+ if (item.offlinePrice != null && item.onlinePrice != null) {
+ item.downlinePrice = Number((Number(item.offlinePrice) + Number(item.onlinePrice)).toFixed(2)) || 0;
+ item.totalPrice = Number((Number(item.downlinePrice) + Number(item.onlinePrice)).toFixed(2)) || 0;
+ } else {
+ item.totalPrice = 0;
+ }
+ });
formData.value = val
- console.log('%csrc/views/crm/quotation/components/QuotationProductDetail.vue:134 val', 'color: #007acc;', val);
})
},
{ immediate: true }
diff --git a/src/views/crm/quotation/components/QuotationProductForm.vue b/src/views/crm/quotation/components/QuotationProductForm.vue
index e809fc22d..51a214bff 100644
--- a/src/views/crm/quotation/components/QuotationProductForm.vue
+++ b/src/views/crm/quotation/components/QuotationProductForm.vue
@@ -46,21 +46,29 @@
-
+
-
+
-
+
+
-
+
-
+
+
+
+ {{row.downlinePrice}}
+
+
+
+
{{row.totalPrice}}
@@ -166,7 +174,7 @@ const formRules = reactive({
})
const formRef = ref() // 表单 Ref
-const emit = defineEmits(['update:handleType'])
+const emit = defineEmits(['update:handleType', 'success'])
/** 监听主表的关联字段的变化,加载对应的子表数据 */
watch(
() => props.businessId,
@@ -256,11 +264,13 @@ watch(
// 循环处理
val.forEach((item) => {
if (item.offlinePrice != null && item.onlinePrice != null) {
- item.totalPrice = Number((Number(item.offlinePrice) + Number(item.onlinePrice)).toFixed(2));
+ item.downlinePrice = Number((Number(item.offlinePrice) + Number(item.onlinePrice)).toFixed(2)) || 0;
+ item.totalPrice = Number((Number(item.downlinePrice) + Number(item.onlinePrice)).toFixed(2)) || 0;
} else {
item.totalPrice = 0;
}
});
+ emit('success', formData.value)
},
{ deep: true }
);
diff --git a/src/views/crm/quotation/index.vue b/src/views/crm/quotation/index.vue
index 1666283f1..af91d9cc9 100644
--- a/src/views/crm/quotation/index.vue
+++ b/src/views/crm/quotation/index.vue
@@ -146,11 +146,11 @@
-
-
+
+
@@ -170,7 +170,7 @@
:formatter="dateFormatter"
width="180px"
/>
-
+
编辑
+
+ 进度
+
+
+ 客户确认
+
handleCommand(command, scope.row)"
v-hasPermi="[
'crm:quotation:delete',
@@ -213,13 +233,13 @@
进度
删除
@@ -384,6 +404,7 @@ const handleProcessDetail = (row) => {
const handleEnter = async (row) => {
await QuotationApi.enterQuotation({id: row.id})
message.success('操作成功!')
+ getList()
}
const getName = (opt, val) => {
diff --git a/src/views/task/components/Bouns.vue b/src/views/task/components/Bouns.vue
index 3cf0ba535..911b4e030 100644
--- a/src/views/task/components/Bouns.vue
+++ b/src/views/task/components/Bouns.vue
@@ -37,12 +37,12 @@
新增
-->
-
+ /> -->
@@ -63,14 +63,14 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
const props = defineProps({
id: propTypes.number.def(undefined),
- userOptions: [],
+ userOptions: propTypes.object.def([]),
})
const loading = ref(true) // 列表的加载中
const list = ref([]) // 列表的数据
const total = ref(0) // 列表的总页数
const queryParams = reactive({
pageNo: 1,
- pageSize: 10,
+ pageSize: 999,
projectId: undefined,
userId: undefined,
bonusPercentage: undefined,
@@ -87,6 +87,7 @@ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成
const getList = async () => {
loading.value = true
try {
+ queryParams.projectId = props.id
const data = await ProjectBonusApi.getProjectBonusPage(queryParams)
list.value = data.list
total.value = data.total
diff --git a/src/views/task/components/ProjectTaskForm.vue b/src/views/task/components/ProjectTaskForm.vue
index b0e18051d..53dee6d95 100644
--- a/src/views/task/components/ProjectTaskForm.vue
+++ b/src/views/task/components/ProjectTaskForm.vue
@@ -9,13 +9,20 @@
>
-
-
+
+
-
-
+
+
+
+
@@ -25,7 +32,14 @@
-
+
+
+
@@ -34,7 +48,7 @@
style="width: 100%"
v-model="formData.startDate"
type="date"
- value-format="x"
+ value-format="YYYY-MM-DD"
placeholder="选择开始日期"
/>
@@ -45,19 +59,31 @@
v-model="formData.endDate"
style="width: 100%"
type="date"
- value-format="x"
+ value-format="YYYY-MM-DD"
placeholder="选择截止日期"
/>
-
+
+
+
-
+
+
+
+
+
+
-
+
@@ -75,16 +101,30 @@
\ No newline at end of file
diff --git a/src/views/task/components/TaskDetail.vue b/src/views/task/components/TaskDetail.vue
new file mode 100644
index 000000000..439ba23b2
--- /dev/null
+++ b/src/views/task/components/TaskDetail.vue
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/task/project/ProjectForm.vue b/src/views/task/project/ProjectForm.vue
index 10936f625..f8d24a502 100644
--- a/src/views/task/project/ProjectForm.vue
+++ b/src/views/task/project/ProjectForm.vue
@@ -113,7 +113,7 @@
-
+
@@ -183,7 +183,7 @@
任务信息
-
+
diff --git a/src/views/task/project/index.vue b/src/views/task/project/index.vue
index 04a8cd20e..667be2520 100644
--- a/src/views/task/project/index.vue
+++ b/src/views/task/project/index.vue
@@ -6,7 +6,7 @@
:model="queryParams"
ref="queryFormRef"
:inline="true"
- label-width="68px"
+ label-width="90px"
>