|
@@ -9,9 +9,10 @@
|
|
|
<el-row :gutter="0">
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="客户名称" prop="name" :rules="[
|
|
|
- {required: true, message:'客户名称不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-input maxlength="64" v-model="inputForm.name" placeholder="请输入客户名称" clearable></el-input>
|
|
|
+ <span slot="label"><span style="color: red;border-top: 20px">*</span> 客户名称</span>
|
|
|
+ <el-input maxlength="64" v-model="inputForm.name" @input="blurName" @blur="blurName" placeholder="请输入客户名称" clearable></el-input>
|
|
|
+ <div class="usc_code_append_message">{{nameMessage}}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
@@ -127,14 +128,16 @@
|
|
|
:rules="[
|
|
|
{required: true, message:'统一社会信用代码不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-input v-model="inputForm.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
|
|
|
+ <el-input v-model="inputForm.uscCode" @blur="blurUscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
|
|
|
+ <div class="usc_code_append_message">{{uscCodeMessage}}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-if="inputForm.isUscCode === '0'||commonJS.isEmpty(inputForm.isUscCode)" :span="12">
|
|
|
<el-form-item label="统一社会信用代码" prop="uscCode"
|
|
|
:rules="[
|
|
|
]">
|
|
|
- <el-input v-model="inputForm.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
|
|
|
+ <el-input v-model="inputForm.uscCode" @blur="blurUscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
|
|
|
+ <div class="usc_code_append_message">{{uscCodeMessage}}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -160,19 +163,20 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="经营范围" prop="businessScope"
|
|
|
+ <el-form-item label="主要职责" prop="keyResponsibilities"
|
|
|
:rules="[
|
|
|
]">
|
|
|
- <el-input v-model="inputForm.businessScope" placeholder="请填写经营范围" clearable></el-input>
|
|
|
+ <el-input v-model="inputForm.keyResponsibilities" placeholder="请填写主要职责" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="主要职责" prop="keyResponsibilities"
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="经营范围" prop="businessScope"
|
|
|
:rules="[
|
|
|
]">
|
|
|
- <el-input v-model="inputForm.keyResponsibilities" placeholder="请填写主要职责" clearable></el-input>
|
|
|
+ <el-input type="textarea" maxlength="250" v-model="inputForm.businessScope" placeholder="请填写经营范围" show-word-limit></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="所属行业" prop="industry"
|
|
|
:rules="[
|
|
@@ -210,21 +214,21 @@
|
|
|
<el-input v-model="inputForm.organizationTypeName" @focus="openOrganizationType()" placeholder="请填写按组织类型分类" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="客户报备类型" prop="reportType"
|
|
|
- :rules="[
|
|
|
- {required: true, message:'客户报备类型不能为空', trigger:'blur'}
|
|
|
- ]">
|
|
|
- <el-select v-model="inputForm.reportType" placeholder="请选择客户报备类型" clearable style="width: 100%;">
|
|
|
- <el-option
|
|
|
- v-for="item in $dictUtils.getDictList('cw_work_client_report_type')"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+<!-- <el-col :span="12">-->
|
|
|
+<!-- <el-form-item label="客户报备类型" prop="reportType"-->
|
|
|
+<!-- :rules="[-->
|
|
|
+<!-- {required: true, message:'客户报备类型不能为空', trigger:'blur'}-->
|
|
|
+<!-- ]">-->
|
|
|
+<!-- <el-select v-model="inputForm.reportType" placeholder="请选择客户报备类型" clearable style="width: 100%;">-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="item in $dictUtils.getDictList('cw_work_client_report_type')"-->
|
|
|
+<!-- :key="item.value"-->
|
|
|
+<!-- :label="item.label"-->
|
|
|
+<!-- :value="item.value">-->
|
|
|
+<!-- </el-option>-->
|
|
|
+<!-- </el-select>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="上级部门" prop="oneUpOffice"
|
|
|
:rules="[
|
|
@@ -600,7 +604,6 @@
|
|
|
</el-row>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="客户联系人" name="contact">
|
|
|
- <span slot="label"><span style="color: red;border-top: 20px">*</span> 客户联系人</span>
|
|
|
<el-row :gutter="15">
|
|
|
<el-button type="primary" style="margin-bottom: 15px" size="mini" :disabled="status === 'audit' || status === 'taskFormDetail'" @click="insertEvent('contact')">
|
|
|
新增客户联系人
|
|
@@ -796,7 +799,11 @@
|
|
|
isUscCode: '',
|
|
|
manageLevelTypeName: '',
|
|
|
organizationTypeName: '',
|
|
|
- remarks: ''
|
|
|
+ remarks: '',
|
|
|
+ updateUser: '',
|
|
|
+ updateRequestId: '',
|
|
|
+ updateUserName: '',
|
|
|
+ requestUserId: ''
|
|
|
},
|
|
|
keyWatch: '',
|
|
|
activeName: 'base',
|
|
@@ -854,7 +861,9 @@
|
|
|
contactFirst: [
|
|
|
{required: true, message: '联系方式1不可以为空'}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ uscCodeMessage: '',
|
|
|
+ nameMessage: ''
|
|
|
}
|
|
|
},
|
|
|
workClientService: null,
|
|
@@ -901,6 +910,8 @@
|
|
|
this.keyWatch = keyWatch
|
|
|
},
|
|
|
init (method, id) {
|
|
|
+ this.uscCodeMessage = ''
|
|
|
+ this.nameMessage = ''
|
|
|
this.activeName = 'base'
|
|
|
this.workClientService = new WorkClientService()
|
|
|
this.method = method
|
|
@@ -970,7 +981,11 @@
|
|
|
isUscCode: '',
|
|
|
manageLevelTypeName: '',
|
|
|
organizationTypeName: '',
|
|
|
- remarks: ''
|
|
|
+ remarks: '',
|
|
|
+ updateUser: '',
|
|
|
+ updateRequestId: '',
|
|
|
+ updateUserName: '',
|
|
|
+ requestUserId: ''
|
|
|
}
|
|
|
this.inputForm.id = id
|
|
|
this.loading = false
|
|
@@ -1011,7 +1026,7 @@
|
|
|
if (this.commonJS.isEmpty(this.inputForm.companyLevel)) {
|
|
|
this.inputForm.companyLevel = '1'
|
|
|
}
|
|
|
- if (this.formReadOnly) {
|
|
|
+ if (this.status === 'audit' || this.status === 'taskFormDetail') {
|
|
|
this.method = 'view'
|
|
|
}
|
|
|
this.$refs.uploadComponent.newUpload(this.method, this.inputForm.workAttachmentDtoList, 'cw_work_client', null, null, null, null, false)
|
|
@@ -1040,25 +1055,107 @@
|
|
|
this.doSubmit('save', callback)
|
|
|
},
|
|
|
startForm (callback) {
|
|
|
+ // 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
+ this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
|
|
|
+ this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
|
|
|
+ if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
|
|
|
+ this.uscCodeMessage = ''
|
|
|
+ this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
|
|
|
+ this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
|
+ if (client.data.use === 'false' || name.data === this.inputForm.name) {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ this.nameMessage = ''
|
|
|
+ } else {
|
|
|
+ this.nameMessage = '该客户已存在'
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uscCodeMessage = '该客户已存在'
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
|
|
|
+ this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
|
+ if (client.data.use === 'false' || name.data === this.inputForm.name) {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ this.nameMessage = ''
|
|
|
+ } else {
|
|
|
+ this.nameMessage = '该客户已存在'
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ startFormTrue (callback) {
|
|
|
if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
|
|
|
this.$message.error('“开票信息”中至少有一条数据')
|
|
|
throw new Error('“开票信息”中至少有一条数据')
|
|
|
- } else if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
|
|
|
- this.$message.error('“客户联系人”信息中至少有一条数据')
|
|
|
- throw new Error('“客户联系人”信息中至少有一条数据')
|
|
|
} else {
|
|
|
- this.doSubmit('start', callback)
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.updateRequestId)) {
|
|
|
+ this.workClientService.pushUpdate(this.inputForm.id).then(({data}) => {
|
|
|
+ this.inputForm.updateRequestId = data.id
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.workClientService.rebackPushUpdate(this.inputForm.id).then(() => {
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
reapplyForm (callback) {
|
|
|
+ // 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
+ this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
|
|
|
+ this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
|
|
|
+ if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
|
|
|
+ this.uscCodeMessage = ''
|
|
|
+ this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
|
|
|
+ this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
|
+ if (client.data.use === 'false' || name.data === this.inputForm.name) {
|
|
|
+ this.reapplyFormTrue(callback)
|
|
|
+ this.nameMessage = ''
|
|
|
+ } else {
|
|
|
+ this.nameMessage = '该客户已存在'
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uscCodeMessage = '该客户已存在'
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
|
|
|
+ this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
|
+ if (client.data.use === 'false' || name.data === this.inputForm.name) {
|
|
|
+ this.reapplyFormTrue(callback)
|
|
|
+ this.nameMessage = ''
|
|
|
+ } else {
|
|
|
+ this.nameMessage = '该客户已存在'
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ reapplyFormTrue (callback) {
|
|
|
this.workClientService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
|
|
|
- this.$message.error('“客户联系人”信息中至少有一条数据')
|
|
|
- throw new Error('“客户联系人”信息中至少有一条数据')
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
|
|
|
+ this.$message.error('“开票信息”中至少有一条数据')
|
|
|
+ throw new Error('“开票信息”中至少有一条数据')
|
|
|
} else {
|
|
|
this.doSubmit('reapply', callback)
|
|
|
}
|
|
@@ -1097,6 +1194,8 @@
|
|
|
} else if (status === 'start') {
|
|
|
// 送审 待审核
|
|
|
this.inputForm.status = '2'
|
|
|
+ this.inputForm.requestUserId = this.$store.state.user.id
|
|
|
+ this.inputForm.assignee = this.inputForm.updateUser
|
|
|
} else if (status === 'agree') {
|
|
|
// 审核同意
|
|
|
this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
@@ -1104,6 +1203,8 @@
|
|
|
this.inputForm.status = '5'
|
|
|
} else if (status === 'reapply') {
|
|
|
this.inputForm.status = '2'
|
|
|
+ this.inputForm.requestUserId = this.$store.state.user.id
|
|
|
+ this.inputForm.assignee = this.inputForm.updateUser
|
|
|
}
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -1120,6 +1221,12 @@
|
|
|
this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
}
|
|
|
this.workClientService.saveForm(this.inputForm).then(({data}) => {
|
|
|
+ if (status === 'agree') {
|
|
|
+ this.workClientService.agreeUpdate(data.businessId)
|
|
|
+ }
|
|
|
+ if (status === 'reapply') {
|
|
|
+ this.workClientService.reapplyUpdate(data.businessId)
|
|
|
+ }
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|
|
@@ -1144,13 +1251,17 @@
|
|
|
this.inputForm.status = '4'
|
|
|
let param = {status: '4', id: this.inputForm.id}
|
|
|
this.workClientService.updateStatusById(param).then(() => {
|
|
|
+ this.workClientService.rejectUpdate(this.inputForm.id)
|
|
|
callback()
|
|
|
})
|
|
|
}
|
|
|
if (type === 'reback') {
|
|
|
// 撤回
|
|
|
let param = {status: '3', id: this.inputForm.id}
|
|
|
- this.workClientService.updateStatusById(param)
|
|
|
+ this.workClientService.updateStatusById(param).then(() => {
|
|
|
+ this.workClientService.rebackUpdate(this.inputForm.id)
|
|
|
+ callback()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -1161,8 +1272,7 @@
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
// 终止
|
|
|
- let param = {status: '1', id: this.inputForm.id}
|
|
|
- this.workClientService.updateStatusById(param).then(() => {
|
|
|
+ this.workClientService.stopUpdate(this.inputForm.id).then(() => {
|
|
|
callback()
|
|
|
})
|
|
|
}
|
|
@@ -1239,10 +1349,16 @@
|
|
|
isUscCode: '',
|
|
|
manageLevelTypeName: '',
|
|
|
organizationTypeName: '',
|
|
|
- remarks: ''
|
|
|
+ remarks: '',
|
|
|
+ updateUser: '',
|
|
|
+ updateRequestId: '',
|
|
|
+ updateUserName: '',
|
|
|
+ requestUserId: ''
|
|
|
}
|
|
|
this.$refs.uploadComponent.clearUpload()
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
+ this.uscCodeMessage = ''
|
|
|
+ this.nameMessage = ''
|
|
|
},
|
|
|
tabHandleClick (event) {
|
|
|
this.tableKeyBilling = Math.random()
|
|
@@ -1258,6 +1374,14 @@
|
|
|
this.inputForm.name = data.data.ENTNAME
|
|
|
this.inputForm.uscCode = data.data.UNCID
|
|
|
this.inputForm.address = data.data.OPLOC
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.name)) {
|
|
|
+ this.blurName(this.inputForm.name)
|
|
|
+ }
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
+ this.blurUscCode(this.inputForm.uscCode)
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
})
|
|
|
this.visiblePop = false
|
|
|
},
|
|
@@ -1453,11 +1577,11 @@
|
|
|
this.loading = false
|
|
|
throw new Error('基本信息中,”企业隶属关系划分“未填写')
|
|
|
}
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.reportType)) {
|
|
|
- this.$message.error('基本信息中,”客户报备类型“未填写')
|
|
|
- this.loading = false
|
|
|
- throw new Error('基本信息中,”客户报备类型“未填写')
|
|
|
- }
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.reportType)) {
|
|
|
+ // this.$message.error('基本信息中,”客户报备类型“未填写')
|
|
|
+ // this.loading = false
|
|
|
+ // throw new Error('基本信息中,”客户报备类型“未填写')
|
|
|
+ // }
|
|
|
if (this.commonJS.isEmpty(this.inputForm.address)) {
|
|
|
this.$message.error('基本信息中,”地址“未填写')
|
|
|
this.loading = false
|
|
@@ -1549,6 +1673,57 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ // 统一社会信用代码blur事件
|
|
|
+ blurUscCode () {
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
|
|
|
+ this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
|
|
|
+ this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
|
|
|
+ if (data.use !== 'false' && this.commonJS.isNotEmpty(data.use) && this.commonJS.isNotEmpty(data.id) && this.inputForm.uscCode !== uscCode.data) {
|
|
|
+ this.uscCodeMessage = '该客户已存在'
|
|
|
+ if (data.isUpdate === 'false') {
|
|
|
+ this.$message.error('该客户信息已存在并且数据正在修改中')
|
|
|
+ } else {
|
|
|
+ this.$confirm(`该客户信息已存在是否进行信息修改?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.close()
|
|
|
+ if (data.use === '0') {
|
|
|
+ this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
|
|
|
+ this.$router.push({path: '/cw/workClientInfo/WorkClientList', query: {dataId: data.id, methodName: 'updateFlowAbleData'}})
|
|
|
+ }
|
|
|
+ if (data.use === '1') {
|
|
|
+ this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
|
|
|
+ this.$router.push({path: '/cw/workClientInfo/WorkClientList', query: {dataId: data.id, methodName: 'updateDialogData'}})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.uscCodeMessage = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uscCodeMessage = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 客户名称blur事件
|
|
|
+ blurName () {
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.name)) {
|
|
|
+ this.workClientService.queryNameIsUse(this.inputForm.name).then(({data}) => {
|
|
|
+ this.workClientService.queryNameById(this.inputForm.id).then((name) => {
|
|
|
+ if (data.use !== 'false' && this.commonJS.isNotEmpty(data.use) && this.commonJS.isNotEmpty(data.id) && this.inputForm.name !== name.data) {
|
|
|
+ this.nameMessage = '该客户已存在'
|
|
|
+ } else {
|
|
|
+ this.nameMessage = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.nameMessage = ''
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|