-->
handleCommand(command, scope.row)"
v-hasPermi="[
'crm:contract:update',
@@ -269,7 +269,7 @@
提交审核
@@ -299,7 +299,7 @@
删除
diff --git a/src/views/crm/customercompany/CustomerCompanyForm.vue b/src/views/crm/customercompany/CustomerCompanyForm.vue
index ab0b63a3d..28798d798 100644
--- a/src/views/crm/customercompany/CustomerCompanyForm.vue
+++ b/src/views/crm/customercompany/CustomerCompanyForm.vue
@@ -15,7 +15,7 @@
-
+
diff --git a/src/views/crm/quotation/QuotationDetail.vue b/src/views/crm/quotation/QuotationDetail.vue
index f632f5d77..78db805f4 100644
--- a/src/views/crm/quotation/QuotationDetail.vue
+++ b/src/views/crm/quotation/QuotationDetail.vue
@@ -14,14 +14,15 @@
-
+
+
@@ -287,10 +288,10 @@
-
+
+
@@ -514,7 +516,7 @@
-
+
报价产品关联
-
+
+
@@ -582,7 +585,7 @@ import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
import { defaultProps, handleTree } from '@/utils/tree'
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
-import QuotationProductForm from './components/QuotationProductDetail.vue'
+import QuotationProductForm from './components/QuotationProductForm.vue'
import * as ContractApi from '@/api/crm/contract'
import * as CustomerApi from '@/api/crm/customer'
import * as UserApi from '@/api/system/user'
@@ -630,11 +633,13 @@ const print=ref({
clickMounted() { console.log('点击v-print绑定的按钮了!') },
})
+const handleType = ref('')
const serviceDesc = ref({
1:'按单项产品的订单量(机票/张,酒店/间夜,火车票/张、用车/单)分别收取服务费',
2: '按订单总金额乘以比例收取服务费用',
3: ''
})
+const statement = ref(new Array(31).fill(null))
const insuranceList = ref([])
const isTrue = ref(false)
const dialogVisible = ref(false) // 弹窗的是否展示
@@ -668,7 +673,7 @@ const formFields = ref({ //字段显示隐藏权限控制,字段顺序就是显
bankAccount: 1,
legalRepresentative: 1,
deptId: 1,
- ownerUserId: 1,
+ requestorUserId: 1,
clueDeveloper: 1,
maintainer: 1,
pricingUserId: 1,
@@ -717,7 +722,7 @@ const formData = ref({
invoiceTemplateId: undefined,
processInstanceId: undefined,
auditStatus: undefined,
- ownerUserId: undefined,
+ requestorUserId: undefined,
expanderUserId: undefined,
pricingUserId: undefined,
signUserId: undefined,
@@ -783,14 +788,44 @@ 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.basicServiceFee) {
+ totalOnlinePrice += Number(product.basicServiceFee || null);
+ }
+ if (typeof product.totalServiceFee) {
+ totalOfflinePrice += Number(product.totalServiceFee || null);
+ }
+ }
+ formData.value.onlinePrice = totalOnlinePrice.toFixed(2) || ''
+ // formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
+ // let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice
+ formData.value.totalPrice = totalOfflinePrice.toFixed(2) || ''
+ },
+ { deep: true }
+);
+
const onBusinessChange = async (businessId: string) => {
if (!businessId) return
+
+ handleType.value = 1
+
try {
formLoading.value = true;
const res = await BusinessApi.getBusiness(businessId);
formData.value.customerId = res.customerId;
formData.value.creditLimit = res.creditLimit; // 保存详情信息
- formData.value.ownerUserId = res.ownerUserId; // 保存详情信息
+ formData.value.requestorUserId = res.requestorUserId; // 保存详情信息
formData.value.paymentTerm = res.paymentTerm;
formData.value.creditMethod = res.creditMethod;
formData.value.creditCalcCycle = res.creditCalcCycle;
@@ -844,13 +879,52 @@ const changeInsuranceId = (val) => {
}
+// const changeQuotation = (val) => {
+// if(serviceDesc.value[val]) {
+// remark.value = '注:' + serviceDesc.value[val]
+// } else {
+// remark.value = ''
+// }
+// // formData.value.insuranceId = ''
+// }
+
const changeQuotation = (val) => {
if(serviceDesc.value[val]) {
remark.value = '注:' + serviceDesc.value[val]
} else {
remark.value = ''
}
- // formData.value.insuranceId = ''
+ formData.value.insuranceId = ''
+ changeQuotationTimes(val)
+ handleClick()
+}
+
+const changeQuotationTimes = async(val) => {
+ if(formData.value.serviceFeeCollectionMethodId && formData.value.businessId) {
+ newProducts.value = []
+ formData.value.products.forEach( item => {
+ newProducts.value.push({
+ id: item.productId,
+ productUnit: item.productUnit,
+ productName: item.productName,
+ detailType: item.detailType,
+ category: item.category
+ })
+ })
+ let data = {
+ businessId: formData.value.businessId,
+ creditMethod: formData.value.creditMethod,
+ serviceFeeCollectionMethodId: formData.value.serviceFeeCollectionMethodId,
+ paymentTerm: formData.value.paymentTerm,
+ quotationProducts: newProducts.value
+ }
+
+ let num = await QuotationApi.getServerFee(data)
+ num.quotationProducts.forEach( v => {
+ v.productUnit = v.serviceFeeVO.unit
+ })
+ formData.value.QuotationTimes = num.quotationProducts
+ }
}
const onPartnerChange = async (id: string) => {
@@ -870,6 +944,10 @@ const onPartnerChange = async (id: string) => {
}
}
+const setSuccess = (val) => {
+ formData.value.products = val
+}
+
const changeNum = (val) => {
formData.value.creditLimit = (Number(val) + (formData.value.creditAmount || 0)).toFixed(2)
}
@@ -885,8 +963,8 @@ const handleClick = (val) => {
formData.value.products.forEach( item => {
newProducts.value.push({
id: item.productId,
- onlinePrice: item.onlinePrice,
- offlinePrice: item.offlinePrice,
+ // onlinePrice: item.onlinePrice,
+ // offlinePrice: item.offlinePrice,
productUnit: item.productUnit,
productName: item.productName,
detailType: item.detailType,
@@ -919,14 +997,14 @@ const open = async (type: string) => {
if (typeof product.onlinePrice) {
totalOnlinePrice += Number(product.onlinePrice);
}
- if (typeof product.offlinePrice) {
- totalOfflinePrice += Number(product.offlinePrice);
- }
+ // if (typeof product.offlinePrice) {
+ // totalOfflinePrice += Number(product.offlinePrice);
+ // }
}
handleClick()
formData.value.serviceFeeCollectionMethodId = Number(formData.value.serviceFeeCollectionMethodId)
// formData.value.onlinePrice = totalOnlinePrice.toFixed(2)
- formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
+ // formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
// let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice
// formData.value.totalPrice = all.toFixed(2)
if(formData.value.insuranceId) {
@@ -944,7 +1022,6 @@ const open = async (type: string) => {
// 获得用户列表
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
}
-defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const printContent = () => {
// 使用 window.print() 来触发打印
@@ -955,7 +1032,7 @@ const printContent = () => {
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
const submitForm = async () => {
// 校验表单
- await formRef.value.validate()
+ await formRef.value.innerFormRef.validate()
// 校验子表单
try {
await quotationProductFormRef.value.validate()
@@ -969,22 +1046,17 @@ const submitForm = async () => {
const data = formData.value as unknown as QuotationVO
// 拼接子表的数据
data.quotationProducts = quotationProductFormRef.value.getData()
- if (!formType.value) {
- await QuotationApi.createQuotation(data)
- message.success(t('common.createSuccess'))
- } else {
- await QuotationApi.updateQuotation(data)
- message.success(t('common.updateSuccess'))
- }
+ await QuotationApi.updateQuotation(data)
+ message.success(t('common.updateSuccess'))
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
- goBack()
} finally {
formLoading.value = false
}
}
+defineExpose({ open, submitForm }) // 提供 open 方法,用于打开弹窗
const goBack = ()=> {
proxy.$router.go(-1)
diff --git a/src/views/crm/quotation/QuotationForm.vue b/src/views/crm/quotation/QuotationForm.vue
index dd8bedab2..f8cc32a67 100644
--- a/src/views/crm/quotation/QuotationForm.vue
+++ b/src/views/crm/quotation/QuotationForm.vue
@@ -10,7 +10,7 @@
-
+
+
+
+
+
+
+
@@ -238,7 +251,7 @@
-
+
diff --git a/src/views/crm/quotation/index.vue b/src/views/crm/quotation/index.vue
index e5c7f4017..40acdc5a9 100644
--- a/src/views/crm/quotation/index.vue
+++ b/src/views/crm/quotation/index.vue
@@ -126,7 +126,7 @@
-
+