|
@@ -8,14 +8,12 @@
|
|
@close="close(),closeXTable()"
|
|
@close="close(),closeXTable()"
|
|
@keyup.enter.native="doSubmit"
|
|
@keyup.enter.native="doSubmit"
|
|
:visible.sync="visible">
|
|
:visible.sync="visible">
|
|
- <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
|
|
|
+ <el-form size="middle" :model="inputForm" ref="inputForm" :rules="rules" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
label-width="150px">
|
|
label-width="150px">
|
|
<el-row :gutter="0">
|
|
<el-row :gutter="0">
|
|
<el-col :span="10">
|
|
<el-col :span="10">
|
|
- <el-form-item label="客户名称" prop="workClientInfo.name" :rules="[
|
|
|
|
- {required: true, message:'请输入客户名称', trigger:'blur'}
|
|
|
|
- ]">
|
|
|
|
- <el-input maxlength="64" @blur="isExistByName" v-model="inputForm.workClientInfo.name" placeholder="请输入客户名称"></el-input>
|
|
|
|
|
|
+ <el-form-item label="客户名称" prop="workClientInfo.name">
|
|
|
|
+ <el-input maxlength="64" v-model="inputForm.workClientInfo.name" placeholder="请输入客户名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="2">
|
|
<el-col :span="2">
|
|
@@ -84,11 +82,8 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
- <el-form-item label="统一社会信用代码" prop="workClientInfo.uscCode" v-if="inputForm.workClientInfo.hasUscc === '1'"
|
|
|
|
- :rules="[
|
|
|
|
- {required: true, message:'请输入统一社会信用代码', trigger:'blur'}
|
|
|
|
- ]">
|
|
|
|
- <el-input maxlength="64" @blur="isExistByUscCode" v-model="inputForm.workClientInfo.uscCode" placeholder="请输入统一社会信用代码"></el-input>
|
|
|
|
|
|
+ <el-form-item label="统一社会信用代码" prop="workClientInfo.uscCode" v-if="inputForm.workClientInfo.hasUscc === '1'">
|
|
|
|
+ <el-input maxlength="64" v-model="inputForm.workClientInfo.uscCode" placeholder="请输入统一社会信用代码"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
@@ -345,6 +340,12 @@
|
|
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
|
|
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
|
|
+ let checkUscCode = (rule, value, callback) => {
|
|
|
|
+ this.haveUscCode(value, callback)
|
|
|
|
+ }
|
|
|
|
+ let checkWorkClient = (rule, value, callback) => {
|
|
|
|
+ this.haveWorkClient(value, callback)
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
visable: false,
|
|
visable: false,
|
|
gridData: [],
|
|
gridData: [],
|
|
@@ -461,7 +462,17 @@
|
|
onedit: false,
|
|
onedit: false,
|
|
type: '',
|
|
type: '',
|
|
loadProgress: 0, // 动态显示进度条
|
|
loadProgress: 0, // 动态显示进度条
|
|
- progressFlag: false // 关闭进度条
|
|
|
|
|
|
+ progressFlag: false, // 关闭进度条
|
|
|
|
+ rules: {
|
|
|
|
+ 'workClientInfo.uscCode': [
|
|
|
|
+ {required: true, validator: checkUscCode, trigger: 'blur'},
|
|
|
|
+ {required: true, validator: checkUscCode, trigger: 'change'}
|
|
|
|
+ ],
|
|
|
|
+ 'workClientInfo.name': [
|
|
|
|
+ {required: true, validator: checkWorkClient, trigger: 'blur'},
|
|
|
|
+ {required: true, validator: checkWorkClient, trigger: 'change'}
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
@@ -498,6 +509,32 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ haveUscCode (value, callback) {
|
|
|
|
+ if (!this.commonJS.isEmpty(value)) {
|
|
|
|
+ this.workClientService.haveUscCode(this.inputForm.id, value).then((data) => {
|
|
|
|
+ if (!data.data) {
|
|
|
|
+ callback(new Error('该统一社会信用代码已存在'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ callback(new Error('统一社会信用代码不可以为空'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ haveWorkClient (value, callback) {
|
|
|
|
+ if (!this.commonJS.isEmpty(value)) {
|
|
|
|
+ this.workClientService.haveWorkClient(this.inputForm.id, value).then((data) => {
|
|
|
|
+ if (!data.data) {
|
|
|
|
+ callback(new Error('该客户名称已存在'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ callback(new Error('客户名称不可以为空'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 关闭查看器
|
|
// 关闭查看器
|
|
closeViewer () {
|
|
closeViewer () {
|
|
this.url = ''
|
|
this.url = ''
|
|
@@ -636,7 +673,24 @@
|
|
},
|
|
},
|
|
// 表单提交
|
|
// 表单提交
|
|
doSubmit () {
|
|
doSubmit () {
|
|
- if (this.isExistByName() === undefined) {
|
|
|
|
|
|
+ if (!this.commonJS.isEmpty(this.inputForm.workClientInfo.uscCode)) {
|
|
|
|
+ this.workClientService.haveUscCode(this.inputForm.id, this.inputForm.workClientInfo.uscCode).then((data) => {
|
|
|
|
+ if (!data.data) {
|
|
|
|
+ this.$message.error('该统一社会信用代码已存在')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('统一社会信用代码为空')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.commonJS.isEmpty(this.inputForm.workClientInfo.name)) {
|
|
|
|
+ this.workClientService.haveWorkClient(this.inputForm.id, this.inputForm.workClientInfo.name).then((data) => {
|
|
|
|
+ if (!data.data) {
|
|
|
|
+ this.$message.error('该客户名称已存在')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('客户名称为空')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if (this.$refs.uploadComponent.checkProgress()) {
|
|
if (this.$refs.uploadComponent.checkProgress()) {
|