[需求变更] 普通项目、工作组成员维护新增/编辑页面合同编号输入框变成下拉选择
This commit is contained in:
@@ -82,8 +82,8 @@ const getIsAssociatedProject = (param) => getAction('/contract/payIncomeContract
|
|||||||
const aduitExpenditureContract = (param) => postAction('/contract/paySpendingContract/audit', param)
|
const aduitExpenditureContract = (param) => postAction('/contract/paySpendingContract/audit', param)
|
||||||
// 支出合同存档
|
// 支出合同存档
|
||||||
const archiveExpenditureContract = (param) => postAction('/contract/paySpendingContract/archive', param)
|
const archiveExpenditureContract = (param) => postAction('/contract/paySpendingContract/archive', param)
|
||||||
// 获取全部收入合同
|
// 获取全部收入合同(通过企业id查询列表)
|
||||||
const getAllRevenueContract = (param) => getAction('', param)
|
const getAllRevenueContract = (param) => getAction('/contract/payIncomeContract/queryByCompanyId', param)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getWorkingGroupById,
|
getWorkingGroupById,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ContactManagementModule from '@views/businessManagement/modules/ContactManagementModule'
|
import ContactManagementModule from '@views/businessManagement/modules/ContactManagementModule'
|
||||||
import { getContactsByCompany,getContactsByCompanyNoLimit } from '@api/api'
|
import { getContactsByCompany, getContactsByCompanyNoLimit } from '@api/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SelectContacts',
|
name: 'SelectContacts',
|
||||||
@@ -68,10 +68,10 @@ export default {
|
|||||||
default: 'string'
|
default: 'string'
|
||||||
},
|
},
|
||||||
// 是否调用无权限接口
|
// 是否调用无权限接口
|
||||||
isLimit:{
|
isLimit: {
|
||||||
type:Boolean,
|
type: Boolean,
|
||||||
required:false,
|
required: false,
|
||||||
default:false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -119,35 +119,36 @@ export default {
|
|||||||
* 获取联系人数据
|
* 获取联系人数据
|
||||||
*/
|
*/
|
||||||
getContactsList() {
|
getContactsList() {
|
||||||
|
let params = {}
|
||||||
if (this.selectedCompany && this.selectedCompany.id) {
|
if (this.selectedCompany && this.selectedCompany.id) {
|
||||||
const params = {
|
params.companyId = this.selectedCompany.id
|
||||||
companyId: this.selectedCompany.id
|
} else {
|
||||||
}
|
params.companyId = null
|
||||||
// 是否调用无权限接口
|
|
||||||
if(this.isLimit){
|
|
||||||
// 调用无权限接口
|
|
||||||
return new Promise(resolve => {
|
|
||||||
getContactsByCompanyNoLimit(params).then(res => {
|
|
||||||
this.contactsList = res.result
|
|
||||||
if (this.initContacts && this.initContacts.id) {
|
|
||||||
this.contactsList.push(this.initContacts)
|
|
||||||
}
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
return new Promise(resolve => {
|
|
||||||
getContactsByCompany(params).then(res => {
|
|
||||||
this.contactsList = res.result
|
|
||||||
console.log(this.initContacts)
|
|
||||||
if (this.initContacts && this.initContacts.id) {
|
|
||||||
this.contactsList.push(this.initContacts)
|
|
||||||
}
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 是否调用无权限接口
|
||||||
|
if (this.isLimit) {
|
||||||
|
// 调用无权限接口
|
||||||
|
return new Promise(resolve => {
|
||||||
|
getContactsByCompanyNoLimit(params).then(res => {
|
||||||
|
this.contactsList = res.result
|
||||||
|
if (this.initContacts && this.initContacts.id) {
|
||||||
|
this.contactsList.push(this.initContacts)
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
getContactsByCompany(params).then(res => {
|
||||||
|
this.contactsList = res.result || []
|
||||||
|
if (this.initContacts && this.initContacts.id) {
|
||||||
|
this.contactsList.push(this.initContacts)
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 新建联系人
|
* 新建联系人
|
||||||
@@ -179,7 +180,7 @@ export default {
|
|||||||
// 下拉框的搜索
|
// 下拉框的搜索
|
||||||
filterOption(input, option) {
|
filterOption(input, option) {
|
||||||
return (
|
return (
|
||||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
allowClear
|
allowClear
|
||||||
option-filter-prop="children"
|
option-filter-prop="children"
|
||||||
:filter-option="filterOption">
|
:filter-option="filterOption">
|
||||||
<a-select-option v-for="item in contractList" :key="item.id" :value="item.contractNum">
|
<a-select-option v-for="item in contractList" :key="item" :value="item">
|
||||||
{{ item.contractNum }}
|
{{ item }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
@@ -24,6 +24,14 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: undefined
|
default: undefined
|
||||||
|
},
|
||||||
|
// 选中的企业,用于获取合同列表
|
||||||
|
company: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -32,16 +40,35 @@ export default {
|
|||||||
contractList: []
|
contractList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听企业变化获取合同信息
|
||||||
|
company: {
|
||||||
|
handler() {
|
||||||
|
if (!this.company.id) {
|
||||||
|
this.$message.warn(`请先选择企业`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.initRevenueContractList()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initRevenueContractList()
|
this.initRevenueContractList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 通过企业id获取合同号
|
||||||
|
*/
|
||||||
initRevenueContractList() {
|
initRevenueContractList() {
|
||||||
getAllRevenueContract().then(res => {
|
const param = {
|
||||||
|
companyId: this.company.id
|
||||||
|
}
|
||||||
|
getAllRevenueContract(param).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.contractList = res.result.records
|
this.contractList = res.result
|
||||||
} else {
|
} else {
|
||||||
this.$message.warn(res.message)
|
console.log(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -127,6 +127,7 @@
|
|||||||
<!-- @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>-->
|
<!-- @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>-->
|
||||||
<select-revenue-contract
|
<select-revenue-contract
|
||||||
placeholder="请选择合同号"
|
placeholder="请选择合同号"
|
||||||
|
:company="selectedCompany"
|
||||||
v-decorator="['contractNum',validatorRules.contractNum]"
|
v-decorator="['contractNum',validatorRules.contractNum]"
|
||||||
:disabled="isContractNumDisabled || isAssociatedContract">
|
:disabled="isContractNumDisabled || isAssociatedContract">
|
||||||
</select-revenue-contract>
|
</select-revenue-contract>
|
||||||
@@ -472,8 +473,9 @@ export default {
|
|||||||
this.selectedCompany = value
|
this.selectedCompany = value
|
||||||
this.model.contactsId = undefined
|
this.model.contactsId = undefined
|
||||||
this.model.mailContactsId = undefined
|
this.model.mailContactsId = undefined
|
||||||
|
this.model.contractNum = undefined
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.model, 'contactsId', 'mailContactsId'))
|
this.form.setFieldsValue(pick(this.model, 'contactsId', 'mailContactsId', 'contractNum'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -88,8 +88,10 @@
|
|||||||
<a-col :xl="12" :sm="24">
|
<a-col :xl="12" :sm="24">
|
||||||
<a-form-item label="来款方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="来款方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<span v-if="defaultChargeWay === 2">合同</span>
|
<span v-if="defaultChargeWay === 2">合同</span>
|
||||||
<a-radio-group v-decorator="['chargeWay',validatorRules.chargeWay]" @change="handlechargeWayChange"
|
<a-radio-group v-decorator="['chargeWay',validatorRules.chargeWay]"
|
||||||
v-else :disabled="isAssociatedContract">
|
@change="handlechargeWayChange"
|
||||||
|
v-else
|
||||||
|
:disabled="isAssociatedContract">
|
||||||
<a-radio :value="1">无</a-radio>
|
<a-radio :value="1">无</a-radio>
|
||||||
<a-radio :value="2">合同</a-radio>
|
<a-radio :value="2">合同</a-radio>
|
||||||
<a-radio :value="3">收费通知</a-radio>
|
<a-radio :value="3">收费通知</a-radio>
|
||||||
@@ -145,8 +147,9 @@
|
|||||||
<!-- @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>-->
|
<!-- @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>-->
|
||||||
<select-revenue-contract
|
<select-revenue-contract
|
||||||
placeholder="请选择合同号"
|
placeholder="请选择合同号"
|
||||||
v-decorator="['contractNum',validatorRules.contractNum]">
|
:company="selectedCompany"
|
||||||
:disabled="isContractNumDisabled || isAssociatedContract"
|
:disabled="isContractNumDisabled || isAssociatedContract"
|
||||||
|
v-decorator="['contractNum',validatorRules.contractNum]">
|
||||||
</select-revenue-contract>
|
</select-revenue-contract>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -417,6 +420,7 @@ export default {
|
|||||||
checkAssociatedProject(record.id).then(res => {
|
checkAssociatedProject(record.id).then(res => {
|
||||||
this.disabledCompany = this.disabledChargeCompany || res || (!!record.inAccount && record.inAccount !== 0) || (!!record.makeInvoice && record.makeInvoice !== 0) || (!!record.mail && record.mail !== 0)
|
this.disabledCompany = this.disabledChargeCompany || res || (!!record.inAccount && record.inAccount !== 0) || (!!record.makeInvoice && record.makeInvoice !== 0) || (!!record.mail && record.mail !== 0)
|
||||||
this.isAssociatedContract = res
|
this.isAssociatedContract = res
|
||||||
|
console.log(this.isContractNumDisabled,this.isAssociatedContract, this.isContractNumDisabled || this.isAssociatedContract, '----------------')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.disabledCompany = this.disabledChargeCompany
|
this.disabledCompany = this.disabledChargeCompany
|
||||||
@@ -584,8 +588,9 @@ export default {
|
|||||||
this.model.contactsIdTwo = undefined
|
this.model.contactsIdTwo = undefined
|
||||||
this.model.contactsIdThree = undefined
|
this.model.contactsIdThree = undefined
|
||||||
this.model.mailContactsId = undefined
|
this.model.mailContactsId = undefined
|
||||||
|
this.model.contractNum = undefined
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.model, 'contactsIdOne', 'contactsIdTwo', 'contactsIdThree', 'mailContactsId'))
|
this.form.setFieldsValue(pick(this.model, 'contactsIdOne', 'contactsIdTwo', 'contactsIdThree', 'mailContactsId', 'contractNum'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user