Merge remote-tracking branch 'origin/master'

pull/781/head
苑坤 2025-04-28 20:23:08 +08:00
commit 834420cd64
7 changed files with 78 additions and 60 deletions

View File

@ -1,41 +1,46 @@
import request from '@/config/axios'
// 票据模版 VO
export interface BillTemplateVO {
id: number // 主键
name: string // 名称
status: number // 状态
}
// 票据模版 API
export const BillTemplateApi = {
// 查询票据模版分页
getBillTemplatePage: async (params: any) => {
return await request.get({ url: `/crm/bill-template/page`, params })
},
// 查询票据模版详情
getBillTemplate: async (id: number) => {
return await request.get({ url: `/crm/bill-template/get?id=` + id })
},
// 新增票据模版
createBillTemplate: async (data: BillTemplateVO) => {
return await request.post({ url: `/crm/bill-template/create`, data })
},
// 修改票据模版
updateBillTemplate: async (data: BillTemplateVO) => {
return await request.put({ url: `/crm/bill-template/update`, data })
},
// 删除票据模版
deleteBillTemplate: async (id: number) => {
return await request.delete({ url: `/crm/bill-template/delete?id=` + id })
},
// 导出票据模版 Excel
exportBillTemplate: async (params) => {
return await request.download({ url: `/crm/bill-template/export-excel`, params })
},
}
import request from '@/config/axios'
// 票据模版 VO
export interface BillTemplateVO {
id: number // 主键
name: string // 名称
status: number // 状态
}
// 票据模版 API
export const BillTemplateApi = {
// 查询票据模版分页
getBillTemplatePage: async (params: any) => {
return await request.get({ url: `/crm/bill-template/page`, params })
},
// 查询票据模版详情
getBillTemplate: async (id: number) => {
return await request.get({ url: `/crm/bill-template/get?id=` + id })
},
// 新增票据模版
createBillTemplate: async (data: BillTemplateVO) => {
return await request.post({ url: `/crm/bill-template/create`, data })
},
// 修改票据模版
updateBillTemplate: async (data: BillTemplateVO) => {
return await request.put({ url: `/crm/bill-template/update`, data })
},
// 删除票据模版
deleteBillTemplate: async (id: number) => {
return await request.delete({ url: `/crm/bill-template/delete?id=` + id })
},
// 获得 票据模版列表(精简)
getSimpleList : async () => {
return await request.get({ url: `/crm/bill-template/simple-list` })
},
// 导出票据模版 Excel
exportBillTemplate: async (params) => {
return await request.download({ url: `/crm/bill-template/export-excel`, params })
},
}

View File

@ -159,7 +159,6 @@ const getList = (val: []) => {
// id: undefined,
// productId: undefined,
// productName: undefined,
// productCategoryId: undefined, //
// productUnit: undefined, //
// productNo: undefined, //
// productPrice: undefined, //

View File

@ -85,8 +85,7 @@ const formLoading = ref(false); // 表单的加载中
const formData = ref([]); //
const formRules = reactive({
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
businessPrice: [{ required: true, message: '合同价格不能为空', trigger: 'blur' }],
count: [{ required: true, message: '产品数量不能为空', trigger: 'blur' }]
businessPrice: [{ required: true, message: '合同价格不能为空', trigger: 'blur' }]
});
const formRef = ref(null); // Ref
const productList = ref<ProductApi.ProductVO[]>([]); //
@ -128,7 +127,6 @@ watch(
// id: undefined,
// productId: undefined,
// productName: undefined,
// productCategoryId: undefined, //
// productUnit: undefined, //
// productNo: undefined, //
// productPrice: undefined, //
@ -155,8 +153,7 @@ const getList = (val: []) => {
"detailType": item.detailType,
"productUnit": item.unit,
"onlinePrice": '',
"offlinePrice": '',
"count": ''
"offlinePrice": ''
})
}
})

View File

@ -9,10 +9,10 @@
>
<el-table :data="formData" class="-mt-10px">
<el-table-column label="序号" type="index" width="100" />
<el-table-column label="用户ID" min-width="150">
<el-table-column label="用户" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.userId`" :rules="formRules.userId" class="mb-0px!">
<el-input v-model="row.userId" placeholder="请输入用户ID" />
<el-input v-model="row.userId" placeholder="请输入用户" />
</el-form-item>
</template>
</el-table-column>

View File

@ -24,10 +24,17 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="产品分类编号" min-width="150">
<el-table-column label="产品类别" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.productCategoryId`" :rules="formRules.productCategoryId" class="mb-0px!">
<el-input v-model="row.productCategoryId" placeholder="请输入产品分类编号" disabled />
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_CATEGORY" :value="row.category" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="产品明细" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE" :value="row.detailType" />
</el-form-item>
</template>
</el-table-column>
@ -131,8 +138,7 @@ const handleAdd = () => {
productUnit: undefined, //
productNo: undefined, //
productPrice: undefined, //
contractPrice: undefined,
count: 1
contractPrice: undefined
}
formData.value.push(row)
}

View File

@ -182,9 +182,9 @@
<el-form-item label="票据模板" prop="invoiceTemplateId">
<el-select v-model="formData.invoiceTemplateId" placeholder="请选择票据模板">
<el-option
v-for="dict in userOptions"
v-for="dict in invoiceTemplateList"
:key="dict.id"
:label="dict.nickname"
:label="dict.name"
:value="dict.id"
/>
</el-select>
@ -361,6 +361,7 @@ import * as CustomerApi from '@/api/crm/customer'
import * as UserApi from '@/api/system/user'
import * as DeptApi from '@/api/system/dept'
import * as BusinessApi from '@/api/crm/business'
import {BillTemplateApi } from '@/api/crm/billtemplate'
import { erpPriceMultiply, erpPriceInputFormatter } from '@/utils'
/** CRM 方案报价 表单 */
@ -530,6 +531,8 @@ const open = async (type: string, id?: number) => {
//
deptTree.value = handleTree(await DeptApi.getSimpleDeptList())
deptList.value = await DeptApi.getSimpleDeptList()
//
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
}
defineExpose({ open }) // open

View File

@ -23,10 +23,17 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="产品分类编号" min-width="150">
<el-table-column label="产品类别" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.productCategoryId`" :rules="formRules.productCategoryId" class="mb-0px!">
<el-input v-model="row.productCategoryId" placeholder="请输入产品分类编号" disabled />
<el-form-item :prop="`${$index}.category`" :rules="formRules.category" class="mb-0px!">
<el-input v-model="row.category" placeholder="请输入产品类别" disabled />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="产品明细" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.detailType`" :rules="formRules.detailType" class="mb-0px!">
<el-input v-model="row.detailType" placeholder="产品明细" disabled />
</el-form-item>
</template>
</el-table-column>
@ -111,7 +118,8 @@ const formRules = reactive({
quotationId: [{ required: true, message: '报价编号不能为空', trigger: 'blur' }],
productId: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
productCategoryId: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
category: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
detailType: [{ required: true, message: '产品分类编号不能为空', trigger: 'blur' }],
productUnit: [{ required: true, message: '产品单位不能为空', trigger: 'blur' }],
onlinePrice: [{ required: true, message: '线上价格不能为空', trigger: 'blur' }],
offlinePrice: [{ required: true, message: '线下价格不能为空', trigger: 'blur' }],