合同中公司签约人接口更改 去除签约人

This commit is contained in:
yyy 2025-03-17 14:54:10 +08:00
parent ceebfe772b
commit ad2e48b710

View File

@ -4,72 +4,62 @@
<view class="set-box bg-white">
<uv-alert type="warning" v-if="form.checkStatus == 1" description="合同正在审核中,不可以修改!"></uv-alert>
<uv-alert type="warning" v-else-if="form.checkStatus == 2" description="合同已经审核通过,不可以修改!"></uv-alert>
<uv-form :model="form" ref="uForm" :errorType="errorType" labelWidth="85" :rules="rules">
<!-- <uv-form-item required label="合同编号:" prop="contractNo">
<uv-input v-model="form.contractNo" :disabled="isCheck" />
</uv-form-item> -->
<uv-form-item required label="合同名称:" prop="contractName">
<uv-form :model="form" ref="uForm" :errorType="errorType" labelWidth="98">
<uv-form-item required label="合同名称" prop="contractName">
<uv-input v-model="form.contractName" :disabled="isCheck" placeholder="请输入合同名称" />
</uv-form-item>
<uv-form-item label="选择客户:" @click="type !== 'detail' ? selectShow() : ''" prop="customerName" required>
<uv-input disabledColor="#ffffff" disabled="true" v-model="form.customerName" placeholder="选择客户">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="选择商机:" @click="type !== 'detail' ? selectShow4() : ''" required>
<uv-form-item label="选择商机" @click="type !== 'detail' ? selectShow4() : ''" required>
<uv-input disabledColor="#ffffff" disabled v-model="form.businessName" placeholder="选择商机">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="合同金额:" prop="contractMoney" required>
<uv-form-item label="合同金额" prop="contractMoney" required>
<uv-input type="number" v-model="form.contractMoney" :disabled="isCheck" placeholder="请输入合同金额" />
</uv-form-item>
<uv-form-item label="签约时间 :" @click="type !== 'detail' ? createTimeShow() : ''">
<uv-form-item label="签约日期" @click="type !== 'detail' ? createTimeShow() : ''" required>
<uv-input v-model="form.signingDate" placeholder="选择签约时间 " disabled disabledColor="#ffffff">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="开始时间 :" @click="type !== 'detail' ? createTimeShow2() : ''">
<uv-form-item label="合同开始时间" @click="type !== 'detail' ? createTimeShow2() : ''" required>
<uv-input v-model="form.startDate" placeholder="选择开始时间 " disabled disabledColor="#ffffff">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="结束时间 :" @click="type !== 'detail' ? createTimeShow3() : ''">
<uv-form-item label="合同结束时间" @click="type !== 'detail' ? createTimeShow3() : ''" required>
<uv-input v-model="form.endDate" placeholder="选择结束时间 " disabled disabledColor="#ffffff">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="客户签约人:" @click="type !== 'detail' ? selectShow2() : ''" required>
<uv-input disabledColor="#ffffff" disabled v-model="form.contactsName" placeholder="选择签约人">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="签约公司:" @click="type !== 'detail' ? selectShow6() : ''" required>
<uv-form-item label="签约公司" @click="type !== 'detail' ? selectShow6() : ''" required>
<uv-input disabledColor="#ffffff" disabled v-model="form.companyName" placeholder="选择签约公司">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="公司签约人:" @click="type !== 'detail' ? selectShow3() : ''" required>
<uv-form-item label="公司签约人" @click="type !== 'detail' ? selectShow3() : ''" required>
<uv-input disabledColor="#ffffff" disabled v-model="form.signatoryName" placeholder="选择签约人">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
<uv-form-item label="客户签约人" @click="type !== 'detail' ? selectShow2() : ''">
<uv-input disabledColor="#ffffff" disabled v-model="form.contactsName" placeholder="选择签约人">
<template v-slot:suffix>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-input>
</uv-form-item>
</uv-form>
<!-- 产品 -->
<view class="flex cif-title" @click="type !== 'detail' ? selectProduct() : ''">
@ -105,14 +95,14 @@
<uv-empty text="暂未选择产品" v-else margin-top="50" mode="list"></uv-empty>
</view>
<view class="flex mb-1 mt-1 align-center">
<view class="mr-1" style="width:150rpx">优惠金额:</view>
<view class="mr-1" style="width:150rpx">优惠金额</view>
<view class="flex-1">
<uni-easyinput type="number" :disabled="isCheck" placeholder="请填写优惠金额" @blur="inputChang"
v-model="form.discountRate"></uni-easyinput>
</view>
</view>
<view class="flex mb-1 mt-3 align-center">
<view class="mr-1" style="width: 150rpx">总额:</view>
<view class="mr-1" style="width: 150rpx">总额</view>
<view class="flex-1"><uv-input type="number" v-model="form.totalPrice" :disabled="true" /></view>
</view>
<view class="container-item" style="flex-direction: column;align-items: flex-start;border-bottom: none;">
@ -156,37 +146,6 @@
</view>
</view>
<!-- 选择客户弹窗 -->
<uv-popup mode="bottom" round="38" ref="selectShowRef">
<view class="popup-content">
<view class="popup-title">
<view class="" style="width: 45px;">
</view>
<text class="">选择客户</text>
<view class="" @click="selectShowClose" style="width: 45px;">
<uv-icon name="close" color="#909399" size="24"></uv-icon>
</view>
</view>
<uv-search margin="30rpx 20rpx" shape="square" v-model="keyword" :show-action="false" :clearabled="true"
placeholder="输入客户名称搜索" @change="onSearch"></uv-search>
<scroll-view scroll-y style="height: 760rpx;width: 100%;" @scrolltolower="reachBottom">
<view class="list">
<block v-if="customerList.length > 0">
<view class="mb-4">
<view class="item flex" v-for="(item,index) in customerList" :key="index" @click="onItem(item,index)">
<view class="title">{{item.name}}</view>
<view class="check-icon">
<uv-icon v-if="item.checked" name="checkmark" color="#09b4f1" size="28"></uv-icon>
</view>
</view>
</view>
<uv-load-more :status="listStatus"></uv-load-more>
</block>
<uv-empty text="暂无数据" v-else mode="list"></uv-empty>
</view>
</scroll-view>
</view>
</uv-popup>
<uv-popup mode="bottom" round="38" ref="selectShowRef2">
<view class="popup-content">
<view class="popup-title">
@ -225,6 +184,9 @@
<uv-icon name="close" color="#909399" size="24"></uv-icon>
</view>
</view>
<view style="margin-top: -20rpx;margin-bottom: 20rpx;">
<uv-tabs ref="uvTabsRef" :current="tabCurrent" :list="tabList" @click="tabListClick"></uv-tabs>
</view>
<scroll-view scroll-y style="height: 760rpx;width: 100%;">
<view class="list">
<block v-if="businessList.length > 0">
@ -288,14 +250,15 @@
import {
ref,
unref,
computed
computed,
reactive,
nextTick
} from 'vue'
import {
onLoad,
onShow
} from '@dcloudio/uni-app'
import {
getCustomerListPage,
getContactsPage,
getUserTreeList
} from '@/api/customer'
@ -342,18 +305,11 @@
selectProductList
} = storeToRefs(main)
const title = ref('添加合同')
const labelPosition = ref('left')
const keyword = ref('')
const listStatus = ref('loadmore')
const customerList = ref([])
const goodsName = ref('')
const page = ref(1)
const page3 = ref(1)
const pageSize = ref(15)
const lastPage = ref(false)
const lastPage3 = ref(false)
const selectList = ref([])
const businessData = ref({})
const type = ref('add')
const contractId = ref(0)
const customerId = ref(0)
@ -382,16 +338,9 @@
signatoryId: '', //
signatoryName: '', //
})
const timeText = ref('')
const errorType = ref('message')
const rules = ref({
})
const customerContacts = ref([])
const userList = ref([])
const username = ref('')
const keyword3 = ref('')
const businessList = ref([])
const isCheck = ref(false)
onLoad((e) => {
@ -403,8 +352,8 @@
getContractInfo()
}
getUserList() //
getCustomerList()
getCompanyList() //
getBusinessList() //
})
onShow(() => {
@ -412,6 +361,31 @@
count_price()
})
//
const tabCurrent = ref(0)
const tabList = ref([{
name: '我的商机',
value: 'my'
}, {
name: '下属商机',
value: 'sub'
}])
const businessList = ref([])
const businessParams = reactive({
relation: 'my',
pageNo: 1
})
const getBusinessList = () => {
getBusinessPage(businessParams).then(res => {
businessList.value = res.list
})
}
const tabListClick = (e) => {
tabCurrent.value = e.index
businessParams.relation = e.value
getBusinessList()
}
//
const imgFiles = ref([]) //
const pdfList = ref([]) //pdf
@ -536,7 +510,6 @@
}
}
const selectShowRef = ref()
const selectShow = () => {
unref(selectShowRef).open()
@ -621,12 +594,6 @@
contractId: contractId.value
})
}
//
const onSearch = () => {
page.value = 1
lastPage.value = false
getCustomerList()
}
//
const selectProduct = () => {
@ -635,83 +602,6 @@
});
}
const getCustomerList = async (isNextPage, pages) => {
await getCustomerListPage({
pageNo: page.value,
pageSize: pageSize.value,
relation: 'my',
name: keyword.value,
}).then(res => {
if (res) {
//
if (res.list.length < pageSize.value) {
listStatus.value = 'nomore'
}
//
if (res.list.length == 0) {
lastPage.value = true
}
//
if (isNextPage) {
customerList.value = customerList.value.concat(res.list)
return
}
customerList.value = res.list
if (form.value.customerId) {
customerList.value.forEach((item, index) => {
if (form.value.customerId == item.id) {
item.checked = true
customerName.value = item.name
} else {
item.checked = false
}
})
}
}
})
}
//
const reachBottom = () => {
if (lastPage.value || listStatus.value == 'loading') return
listStatus.value = 'loading'
page.value++
getCustomerList(true, page.value)
if (customerList.value.length >= pageSize.value) {
listStatus.value = 'loadmore';
} else {
listStatus.values = 'loading';
}
}
//
const onItem = async (val, i) => {
customerList.value.forEach((item, index) => {
if (val.id == item.id) {
item.checked = true
val.name = val.name ? val.name : item.name;
} else {
item.checked = false
}
})
form.value.customerId = val.id
form.value.customerName = val.name ? val.name : ''
//
let data = await getContactsPage({
customerId: val.id
})
customerContacts.value = data.list
//
let data2 = await getBusinessPage({
customerId: val.id
})
businessList.value = data2.list
selectShowClose()
}
const selectShowRef2 = ref()
const selectShow2 = () => {
unref(selectShowRef2).open()
@ -752,34 +642,53 @@
form.value.signatoryId = userId[0]
form.value.signatoryName = name
}
//
const selectShowRef4 = ref()
const uvTabsRef = ref()
const selectShow4 = async () => {
unref(selectShowRef4).open()
nextTick(() => {
uvTabsRef.value.init()
})
}
const selectShowClose4 = () => {
unref(selectShowRef4).close()
}
const onItem4 = async (val, i) => {
businessList.value.forEach((item, index) => {
if (val.id == item.id) {
item.checked = true
val.name = val.name ? val.name : item.name;
} else {
item.checked = false
}
})
//
form.value.customerId = val.customerId
form.value.customerName = val.customerName
//
form.value.businessId = val.id
form.value.businessName = val.name ? val.name : ''
form.value.businessName = val.name
//
selectList.value = await getBusinessProductListByBusinessId({
businessId: val.id
})
selectShowClose4()
//
getContactsPageList(val.customerId)
//
setTimeout(() => {
selectShowClose4()
}, 300)
}
//
const getContactsPageList = async (customerId) => {
let data = await getContactsPage({
customerId
})
customerContacts.value = data.list
}
//
const selectShowRef6 = ref()
@ -860,14 +769,6 @@
})
return
}
if (form.value.customerId == '') {
uni.showToast({
icon: 'error',
title: '请选择客户'
})
return
}
if (form.value.businessName == '') {
uni.showToast({
icon: 'error',
@ -875,7 +776,6 @@
})
return
}
if (form.value.contractMoney == '') {
uni.showToast({
icon: 'error',
@ -883,11 +783,31 @@
})
return
}
if (form.value.contactsName == '') {
if (form.value.signingDate == '') {
uni.showToast({
icon: 'error',
title: '请选择客户签约人'
title: '请填写签约日期'
})
return
}
if (form.value.startDate == '') {
uni.showToast({
icon: 'error',
title: '请填写合同开始时间'
})
return
}
if (form.value.endDate == '') {
uni.showToast({
icon: 'error',
title: '请填写合同结束时间'
})
return
}
if (form.value.companyName == '') {
uni.showToast({
icon: 'error',
title: '请选择签约公司'
})
return
}
@ -898,7 +818,6 @@
})
return
}
if (selectList.value.length <= 0) {
uni.showToast({
icon: 'error',
@ -909,7 +828,6 @@
onSubmit()
}
//
const submitBtn = ref(false)
const onSubmit = () => {