合同新增
parent
3705645cd5
commit
21f992ed4d
|
|
@ -88,7 +88,7 @@ const exportLoading = ref(false) // 导出的加载中
|
|||
const open = async (data: [], id) => {
|
||||
dialogVisible.value = true
|
||||
multipleSelection.value = data
|
||||
|
||||
console.log('%csrc/components/contact/index.vue:91 id', 'color: #007acc;', id);
|
||||
queryParams.customerId = id
|
||||
await getList()
|
||||
await setSelections()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<Dialog title="添加员工" v-model="dialogVisible" width="50%">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="单位名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table ref="multipleTableRef" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :row-key="getRowKey" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" type="selection" :reserve-selection="true" />
|
||||
<el-table-column label="姓名" align="center" prop="nickname" />
|
||||
<el-table-column label="部门" align="center" prop="deptName" width="160" />
|
||||
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<!-- <Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/> -->
|
||||
</ContentWrap>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
|
||||
/** 票据模版 列表 */
|
||||
defineOptions({ name: 'BillTemplate' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<BillTemplateVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const multipleSelection = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const multipleTableRef = ref()
|
||||
const selectedRowKeys = ref<number[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
status: 1,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
/** 打开弹窗 */
|
||||
const open = async (data: []) => {
|
||||
console.log('%csrc/components/product/index.vue:102 data', 'color: #007acc;', data);
|
||||
dialogVisible.value = true
|
||||
multipleSelection.value = data
|
||||
await getList()
|
||||
await setSelections()
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
// 跨页唯一id
|
||||
const getRowKey = (row) => {
|
||||
return row.id
|
||||
}
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
// 获得用户列表
|
||||
// userOptions.value = await UserApi.getSimpleUserList()
|
||||
const data = await UserApi.getSimpleUserList()
|
||||
list.value = data
|
||||
// total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const handleSelectionChange = (val: []) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
multipleTableRef.value.clearSelection()
|
||||
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success', multipleSelection.value)
|
||||
}
|
||||
const setSelections = async () => {
|
||||
const selections = multipleSelection.value.map(item => {
|
||||
return {
|
||||
id: item.productId
|
||||
}
|
||||
})
|
||||
console.log('%csrc/components/product/index.vue:153 list.value', 'color: #007acc;', list.value);
|
||||
|
||||
if (selections && selections.length > 0) {
|
||||
list.value.forEach((row: any) => {
|
||||
if (selections.some(item => item.id === row.id)) {
|
||||
multipleTableRef.value.toggleRowSelection(row, true); // 设置选择状态。
|
||||
}
|
||||
});
|
||||
} else {
|
||||
multipleTableRef.value.clearSelection(); // 如果没有保存的选择,则清空当前页的选择。
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -58,7 +58,6 @@
|
|||
<el-col :span="8">
|
||||
<el-form-item label="方案签约人" prop="pricingUserId">
|
||||
<el-select
|
||||
@change="handleQuotationChange"
|
||||
v-model="formData.pricingUserId"
|
||||
class="w-1/1"
|
||||
>
|
||||
|
|
@ -434,28 +433,35 @@
|
|||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
产品清单
|
||||
</ContentWrap>
|
||||
<!-- 子表的表单 -->
|
||||
<ContentWrap>
|
||||
<el-tabs v-model="subTabsName" class="-mt-15px -mb-10px">
|
||||
<el-tab-pane label="产品清单" name="product">
|
||||
<ContractProductForm
|
||||
ref="productFormRef"
|
||||
:products="formData.products"
|
||||
:disabled="disabled"
|
||||
:type="1"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同甲方关联单位" name="contractAAuthorizedCompany">
|
||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :data="formData.contractAAuthorizedCompanys" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同甲方授权人信息" name="contractAAuthorizedPerson">
|
||||
<ContractAAuthorizedPersonForm ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同乙方授权人信息" name="contractBAuthorizedPerson">
|
||||
<ContractBAuthorizedPersonForm ref="contractBAuthorizedPersonFormRef" :contract-id="formData.id" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
合同甲方关联单位
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractAAuthorizedCompanyForm ref="contractAAuthorizedCompanyFormRef" :data="formData.contractAAuthorizedCompanys" :contract-id="formData.id" />
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
合同甲方授权人信息
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractAAuthorizedPersonForm ref="contractAAuthorizedPersonFormRef" :contract-id="formData.id" :customerId="formData.customerId" />
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none;font-weight:700">
|
||||
合同乙方授权人信息
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractBAuthorizedPersonForm ref="contractBAuthorizedPersonFormRef" :userOptions="userOptions" :contract-id="formData.id" />
|
||||
</ContentWrap>
|
||||
</el-form>
|
||||
<!-- 显示在其他页面时的判断type -->
|
||||
|
|
|
|||
|
|
@ -69,12 +69,10 @@
|
|||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||
</el-row>
|
||||
|
||||
<ContactForm ref="contactRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import ContactForm from '@/components/contact/index.vue'
|
||||
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -90,35 +88,22 @@ const formRules = reactive({
|
|||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const contactRef = ref() // 表单 Ref
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
contactRef.value.open(formData.value, props.customerId)
|
||||
}
|
||||
|
||||
|
||||
const getList = (val: []) => {
|
||||
for(let i = val.length - 1; i >= 0; i--) {
|
||||
let obj = val[i]
|
||||
if(formData.value.some(v => v.id === obj.id)) val.splice(i, 1)
|
||||
const row = {
|
||||
unifiedCreditCode: undefined,
|
||||
invoicingAddress: undefined,
|
||||
customerName: undefined,
|
||||
invoicingTelephone: undefined,
|
||||
companyBank: undefined,
|
||||
companyAddress: undefined,
|
||||
companyAccount: undefined
|
||||
}
|
||||
val.forEach(item => {
|
||||
if(!formData.value.some(v => v.id === item.id)) {
|
||||
val.forEach(item => {
|
||||
formData.value.push({
|
||||
"name": item.name,
|
||||
"postId": item.post,
|
||||
"userRank": item.userRank,
|
||||
"phoneNumber": item.mobile,
|
||||
"authDesc": item.authDesc,
|
||||
"wechat":item. wechat,
|
||||
"email":item. email,
|
||||
"id": item.id
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
row.contractId = props.contractId
|
||||
formData.value.push(row)
|
||||
}
|
||||
|
||||
|
||||
const props = defineProps<{
|
||||
data: undefined,
|
||||
type: undefined
|
||||
|
|
|
|||
|
|
@ -135,8 +135,13 @@ watch(
|
|||
// row.contractId = props.contractId
|
||||
// formData.value.push(row)
|
||||
// }
|
||||
const message = useMessage() // 消息弹窗
|
||||
const contactRef = ref() // 表单 Ref
|
||||
const handleAdd = () => {
|
||||
console.log('%csrc/views/crm/contract/components/ContractAAuthorizedPersonForm.vue:140 props.customerId', 'color: #007acc;', props.customerId);
|
||||
if(!props.customerId) {
|
||||
return message.warning('请先选择报价单')
|
||||
}
|
||||
contactRef.value.open(formData.value, props.customerId)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,15 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="姓名" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.name`" :rules="formRules.name" class="mb-0px!">
|
||||
<el-input v-model="row.name" placeholder="请输入姓名" />
|
||||
<el-form-item :prop="`${$index}.userId`" :rules="formRules.name" class="mb-0px!">
|
||||
<el-select v-model="row.userId" placeholder="请选择售后维护人" @change="changeUser($index, row.userId)">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.nickname"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -91,14 +98,17 @@
|
|||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||
</el-row>
|
||||
|
||||
<ContactForm ref="contactRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||
import ContactForm from '@/components/user/index.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
contractId: undefined, // 合同ID(主表的关联字段)
|
||||
type: undefined,
|
||||
userOptions: undefined
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
|
|
@ -150,6 +160,45 @@ const handleAdd = () => {
|
|||
formData.value.push(row)
|
||||
}
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const contactRef = ref() // 表单 Ref
|
||||
// const handleAdd = () => {
|
||||
|
||||
// contactRef.value.open(formData.value, props.customerId)
|
||||
// }
|
||||
const changeUser = (i, val) => {
|
||||
console.log('%csrc/views/crm/contract/components/ContractBAuthorizedPersonForm.vue:170 i,val', 'color: #007acc;',props.userOptions.filter(v => v.id === val), i,val);
|
||||
let arr = props.userOptions.filter(v => v.id === val)
|
||||
if(arr.length) {
|
||||
formData.value[i].name = arr[0].nickname
|
||||
formData.value[i].postId = arr[0].deptName
|
||||
}
|
||||
}
|
||||
const getList = (val: []) => {
|
||||
for(let i = val.length - 1; i >= 0; i--) {
|
||||
let obj = val[i]
|
||||
if(formData.value.some(v => v.id === obj.id)) val.splice(i, 1)
|
||||
}
|
||||
val.forEach(item => {
|
||||
if(!formData.value.some(v => v.id === item.id)) {
|
||||
val.forEach(item => {
|
||||
formData.value.push({
|
||||
"name": item.name,
|
||||
"authType": item.post,
|
||||
"postId": item.userRank,
|
||||
"userRank": item.mobile,
|
||||
"authDesc": item.authDesc,
|
||||
"wechat":item. wechat,
|
||||
"email":item. email,
|
||||
"id": item.id,
|
||||
phoneNumber: item.phoneNumber
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue