|
|
|
@ -57,6 +57,38 @@
|
|
|
|
|
<span class="iconfont icon-time" v-if="auditStatusText == '待审批'"></span>
|
|
|
|
|
<span>{{ auditStatusText }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<Divider type="vertical" />
|
|
|
|
|
<span class="gradeClass">
|
|
|
|
|
<span>客户等级:</span>
|
|
|
|
|
<a-select class="gradeSelect" :bordered="false" v-model:value="grade">
|
|
|
|
|
<a-select-option value="A">A</a-select-option>
|
|
|
|
|
<a-select-option value="B">B</a-select-option>
|
|
|
|
|
<a-select-option value="C">C</a-select-option>
|
|
|
|
|
<a-select-option value="D">D</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</span>
|
|
|
|
|
<Divider type="vertical" />
|
|
|
|
|
<span>
|
|
|
|
|
<a-select
|
|
|
|
|
class="CustomerOrSupplierSelect"
|
|
|
|
|
:class="CustomerOrSupplier"
|
|
|
|
|
:bordered="false"
|
|
|
|
|
v-model:value="CustomerOrSupplier"
|
|
|
|
|
>
|
|
|
|
|
<a-select-option value="isCustomer">
|
|
|
|
|
<span class="iconfont icon-yonghu1"></span>
|
|
|
|
|
客户
|
|
|
|
|
</a-select-option>
|
|
|
|
|
<a-select-option value="isSupplier">
|
|
|
|
|
<span class="iconfont icon-a-dianpushangchengxianxing"></span>
|
|
|
|
|
供应商
|
|
|
|
|
</a-select-option>
|
|
|
|
|
<a-select-option value="isCustomerAndisSupplier">
|
|
|
|
|
<span class="iconfont icon-quxiaopeidui"></span>
|
|
|
|
|
客户&供应商
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ConfigFormBox">
|
|
|
|
|
<ConfigForm
|
|
|
|
@ -174,6 +206,7 @@
|
|
|
|
|
import {
|
|
|
|
|
editCodeGoodsType,
|
|
|
|
|
getCodeGoodsTypeInfo,
|
|
|
|
|
ApiGetUsage,
|
|
|
|
|
editClientBank,
|
|
|
|
|
getClientBankList,
|
|
|
|
|
DeleteInvoiceHeader,
|
|
|
|
@ -182,6 +215,7 @@
|
|
|
|
|
ApiWithdraw,
|
|
|
|
|
} from './api'
|
|
|
|
|
import { GetFormSetListByModule } from '/@/api/common'
|
|
|
|
|
import { ApiList } from './menu2/api'
|
|
|
|
|
// 引入表格权限信息(包含id和name)
|
|
|
|
|
import { permissionsInfo } from '/@/hooks/web/usePermission'
|
|
|
|
|
import { GetClientSourceDetailSelectList } from '/@/views/operation/seaexport/api/BookingLedger'
|
|
|
|
@ -197,12 +231,14 @@
|
|
|
|
|
import { useModal } from '/@/components/Modal'
|
|
|
|
|
import CustomerParams from './customerParams/index.vue'
|
|
|
|
|
import ReleaseType from './ReleaseType/index.vue'
|
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
import { useGo } from '/@/hooks/web/usePage'
|
|
|
|
|
const go = useGo()
|
|
|
|
|
// 字典
|
|
|
|
|
import { getDictOption } from '/@/utils/dictUtil'
|
|
|
|
|
import { up } from 'inquirer/lib/utils/readline'
|
|
|
|
|
// import Menus5 from './menu5/index.vue'
|
|
|
|
|
// import { tr } from 'node_modules/element-plus/es/locale'
|
|
|
|
|
// 声明Emits
|
|
|
|
@ -215,6 +251,8 @@
|
|
|
|
|
const clientId = ref('')
|
|
|
|
|
const customerName = ref('')
|
|
|
|
|
const DIYformSchema = ref([])
|
|
|
|
|
const grade = ref('A')
|
|
|
|
|
const CustomerOrSupplier = ref('')
|
|
|
|
|
// 获取表单设置数据
|
|
|
|
|
const getFormSet = async () => {
|
|
|
|
|
let res: any = await GetFormSetListByModule({ permissionId: permissionsInfo().permissionId })
|
|
|
|
@ -233,14 +271,12 @@
|
|
|
|
|
selectedKeys.value = ['menu1']
|
|
|
|
|
resetFields()
|
|
|
|
|
resetFields1()
|
|
|
|
|
if (route.query.id) {
|
|
|
|
|
if (route.query && route.query.id) {
|
|
|
|
|
rowId.value = route.query.id
|
|
|
|
|
activeKey.value = '2'
|
|
|
|
|
getData(true)
|
|
|
|
|
} else {
|
|
|
|
|
setTableData([])
|
|
|
|
|
clientId.value = ''
|
|
|
|
|
|
|
|
|
|
clientTag_o.value = {
|
|
|
|
|
id: '',
|
|
|
|
|
clientId: '',
|
|
|
|
@ -250,10 +286,16 @@
|
|
|
|
|
}
|
|
|
|
|
rowId.value = ''
|
|
|
|
|
activeKey.value = '2'
|
|
|
|
|
await setFieldsValue({})
|
|
|
|
|
reload()
|
|
|
|
|
setFieldsValue({})
|
|
|
|
|
auditStatusText.value = ''
|
|
|
|
|
activeKey.value = '1'
|
|
|
|
|
await setFieldsValue1({})
|
|
|
|
|
setFieldsValue1({})
|
|
|
|
|
if (route.path == '/CustomerinfoclientDetail') {
|
|
|
|
|
CustomerOrSupplier.value = 'isCustomer'
|
|
|
|
|
} else if (route.path == '/SupplierinfoclientDetail') {
|
|
|
|
|
CustomerOrSupplier.value = 'isSupplier'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
watch(activeKey, (nval, oval) => {
|
|
|
|
@ -490,29 +532,51 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type) {
|
|
|
|
|
console.log(res.data, '??????????????????')
|
|
|
|
|
if (!res.data.serviceItemCodes) {
|
|
|
|
|
res.data.serviceItemCodes = []
|
|
|
|
|
}
|
|
|
|
|
grade.value = res.data.grade
|
|
|
|
|
if (res.data.isCustomer && res.data.isSupplier) {
|
|
|
|
|
CustomerOrSupplier.value = 'isCustomerAndisSupplier'
|
|
|
|
|
} else if (res.data.isCustomer) {
|
|
|
|
|
CustomerOrSupplier.value = 'isCustomer'
|
|
|
|
|
} else if (res.data.isSupplier) {
|
|
|
|
|
CustomerOrSupplier.value = 'isSupplier'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await setFieldsValue({
|
|
|
|
|
...res.data,
|
|
|
|
|
})
|
|
|
|
|
clearValidate()
|
|
|
|
|
auditStatusText.value = res.data.auditStatusText
|
|
|
|
|
let Arr: any = []
|
|
|
|
|
await GetClientSourceDetailSelectList({ id: res.data.sourceId }).then((res) => {
|
|
|
|
|
res.data.forEach((item) => {
|
|
|
|
|
Arr.push({ label: item.detailName, value: item.id })
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// let Arr: any = []
|
|
|
|
|
// await GetClientSourceDetailSelectList({ id: res.data.sourceId }).then((res) => {
|
|
|
|
|
// res.data.forEach((item) => {
|
|
|
|
|
// Arr.push({ label: item.detailName, value: item.id })
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
activeKey.value = '2'
|
|
|
|
|
await setFieldsValue1({
|
|
|
|
|
setFieldsValue1({
|
|
|
|
|
...res.data,
|
|
|
|
|
})
|
|
|
|
|
activeKey.value = '1'
|
|
|
|
|
reload()
|
|
|
|
|
}
|
|
|
|
|
ApiGetUsage({ ids: [unref(rowId)] }).then((res) => {
|
|
|
|
|
if (res.data[0].isUsed) {
|
|
|
|
|
updateSchema({
|
|
|
|
|
field: 'shortName',
|
|
|
|
|
dynamicDisabled: true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
updateSchema({
|
|
|
|
|
field: 'shortName',
|
|
|
|
|
dynamicDisabled: false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -520,7 +584,7 @@
|
|
|
|
|
// 新建
|
|
|
|
|
function handleCreate() {
|
|
|
|
|
const addNum = Math.round(Math.random() * 1000)
|
|
|
|
|
go(`/infoclientDetail?addNum=${addNum}`)
|
|
|
|
|
go(`${route.fullPath}?addNum=${addNum}`)
|
|
|
|
|
}
|
|
|
|
|
// 提交
|
|
|
|
|
async function handleSave() {
|
|
|
|
@ -528,7 +592,6 @@
|
|
|
|
|
const values = await validate().catch(() => {
|
|
|
|
|
notification.warning({ message: '请补全基本信息中必填内容!', duration: 3 })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (values) {
|
|
|
|
|
// setModalProps({ confirmLoading: true, loading: true })
|
|
|
|
|
// TODO custom api
|
|
|
|
@ -549,6 +612,18 @@
|
|
|
|
|
values.clientTag = { ...values.clientTag, ...clientTag_o.value }
|
|
|
|
|
|
|
|
|
|
values.clientTag.others = values.others
|
|
|
|
|
|
|
|
|
|
values.grade = grade.value
|
|
|
|
|
if (CustomerOrSupplier.value == 'isCustomerAndisSupplier') {
|
|
|
|
|
values.isCustomer = true
|
|
|
|
|
values.isSupplier = true
|
|
|
|
|
} else if (CustomerOrSupplier.value == 'isCustomer') {
|
|
|
|
|
values.isCustomer = true
|
|
|
|
|
values.isSupplier = false
|
|
|
|
|
} else if (CustomerOrSupplier.value == 'isSupplier') {
|
|
|
|
|
values.isCustomer = false
|
|
|
|
|
values.isSupplier = true
|
|
|
|
|
}
|
|
|
|
|
// loading.value = true;
|
|
|
|
|
const res = await editCodeGoodsType({
|
|
|
|
|
...values,
|
|
|
|
@ -559,12 +634,12 @@
|
|
|
|
|
rowId.value = res.data
|
|
|
|
|
clientId.value = res.data
|
|
|
|
|
// isUpdate.value = true
|
|
|
|
|
await setFieldsValue({
|
|
|
|
|
...getFieldsValue(),
|
|
|
|
|
id: res.data,
|
|
|
|
|
})
|
|
|
|
|
// await setFieldsValue({
|
|
|
|
|
// // ...getFieldsValue(),
|
|
|
|
|
// id: res.data,
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
getData(false)
|
|
|
|
|
getData(true)
|
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
emit('success')
|
|
|
|
|
} else {
|
|
|
|
@ -586,16 +661,21 @@
|
|
|
|
|
// 提交审核(Auth)
|
|
|
|
|
async function SubmitAudit() {
|
|
|
|
|
if (rowId.value) {
|
|
|
|
|
const auditStatus = getFieldsValue().auditStatus
|
|
|
|
|
if (auditStatus == -1 || auditStatus == 2) {
|
|
|
|
|
let ApiData: any = { ids: [rowId.value] }
|
|
|
|
|
let res = await ApiSubmitAudit(ApiData)
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
getData(true)
|
|
|
|
|
const res = await ApiList(formatParams({ ClientId: clientId.value }))
|
|
|
|
|
if (res.succeeded && res.data.length) {
|
|
|
|
|
const auditStatus = getFieldsValue().auditStatus
|
|
|
|
|
if (auditStatus == -1 || auditStatus == 2) {
|
|
|
|
|
let ApiData: any = { ids: [rowId.value] }
|
|
|
|
|
let res = await ApiSubmitAudit(ApiData)
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
notification.success({ message: res.message, duration: 3 })
|
|
|
|
|
getData(true)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
notification.warning({ message: '当前审核状态,禁止提交审核!', duration: 3 })
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
notification.warning({ message: '当前审核状态,禁止提交审核!', duration: 3 })
|
|
|
|
|
notification.warning({ message: '至少拥有一条联系人信息!', duration: 3 })
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
notification.warning({ message: '请先保存!', duration: 3 })
|
|
|
|
@ -623,6 +703,14 @@
|
|
|
|
|
const res = await getCodeGoodsTypeInfo({ id: unref(rowId) })
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
clientId.value = res.data.id
|
|
|
|
|
grade.value = res.data.grade
|
|
|
|
|
if (res.data.isCustomer && res.data.isSupplier) {
|
|
|
|
|
CustomerOrSupplier.value = 'isCustomerAndisSupplier'
|
|
|
|
|
} else if (res.data.isCustomer) {
|
|
|
|
|
CustomerOrSupplier.value = 'isCustomer'
|
|
|
|
|
} else if (res.data.isSupplier) {
|
|
|
|
|
CustomerOrSupplier.value = 'isSupplier'
|
|
|
|
|
}
|
|
|
|
|
await setFieldsValue({
|
|
|
|
|
...res.data,
|
|
|
|
|
})
|
|
|
|
@ -631,6 +719,25 @@
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.gradeClass {
|
|
|
|
|
color: #2881f4 !important;
|
|
|
|
|
.gradeSelect {
|
|
|
|
|
width: 60px;
|
|
|
|
|
color: #2881f4 !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.CustomerOrSupplierSelect {
|
|
|
|
|
width: 150px;
|
|
|
|
|
&.isCustomer {
|
|
|
|
|
color: #27a9a3 !important;
|
|
|
|
|
}
|
|
|
|
|
&.isSupplier {
|
|
|
|
|
color: #b82a49 !important;
|
|
|
|
|
}
|
|
|
|
|
&.isCustomerAndisSupplier {
|
|
|
|
|
color: #2881f4 !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.auditStatusText {
|
|
|
|
|
color: #333333;
|
|
|
|
|
&.active {
|
|
|
|
|