[update] 收入合同关联优化;支出合同校验修改;系统催款

This commit is contained in:
zhaoxiao
2021-09-09 18:39:05 +08:00
parent cd5e5ae3a3
commit 2bd07a3397
5 changed files with 312 additions and 38 deletions
@@ -278,7 +278,7 @@ export default {
validateTrigger: 'blur' validateTrigger: 'blur'
}, },
contractName: { contractName: {
rules: [{ required: true, validator: this.checkContractName }], rules: [{ required: true, message:'请输入合同名称' }],
validateTrigger: 'blur' validateTrigger: 'blur'
}, },
signedCompany: { signedCompany: {
@@ -440,33 +440,33 @@ export default {
callback('请输入合同编号') callback('请输入合同编号')
} }
}, },
/** // /**
* 合同名称唯一性校验 // * 合同名称唯一性校验
* @param rules // * @param rules
* @param value // * @param value
* @param callback // * @param callback
*/ // */
checkContractName(rules, value, callback) { // checkContractName(rules, value, callback) {
if (value) { // if (value) {
if (!this.model.id) { // if (!this.model.id) {
const params = { // const params = {
confusionCode: 'pay_spending_contract_name', // confusionCode: 'pay_spending_contract_name',
fieldVal: value // fieldVal: value
} // }
duplicateCheck(params).then(res => { // duplicateCheck(params).then(res => {
if (res.success) { // if (res.success) {
callback() // callback()
} else { // } else {
callback('合同名称已存在') // callback('合同名称已存在')
} // }
}) // })
return // return
} // }
callback() // callback()
} else { // } else {
callback('请输入合同名称') // callback('请输入合同名称')
} // }
}, // },
/** /**
* 选中企业变化 * 选中企业变化
* @param value * @param value
@@ -93,17 +93,17 @@
@click="toRevenueContractDetail(record.id, record.contractNum)" @click="toRevenueContractDetail(record.id, record.contractNum)"
v-if="record.chargeStatus === 1" v-if="record.chargeStatus === 1"
:value="text" :value="text"
:length="20"></j-ellipsis> :length="18"></j-ellipsis>
<j-ellipsis <j-ellipsis
class="primary-color" class="primary-color"
@click="toRevenueContractDetail(record.id)" @click="toRevenueContractDetail(record.id)"
v-else v-else
:value="text" :value="text"
:length="20"></j-ellipsis> :length="18"></j-ellipsis>
</template> </template>
<template slot="text" slot-scope="text"> <template slot="text" slot-scope="text">
<j-ellipsis :value="text" :length="20"></j-ellipsis> <j-ellipsis :value="text" :length="18"></j-ellipsis>
</template> </template>
<span slot="action" class="action-span-cell" slot-scope="text, record"> <span slot="action" class="action-span-cell" slot-scope="text, record">
@@ -256,7 +256,7 @@
<select-project-module ref="selectProjectModule" <select-project-module ref="selectProjectModule"
@ok="selectProjectOk" @ok="selectProjectOk"
:depart-id="departId" :depart-id="departId"
:pack="model.pack" :pack="Number(model.pack)"
:contract-id="model.id" :contract-id="model.id"
:project-type="projectType" :project-type="projectType"
:default-contract-num="contractNum" :default-contract-num="contractNum"
@@ -31,10 +31,7 @@
placeholder="请选择负责人" placeholder="请选择负责人"
option-filter-prop="children" option-filter-prop="children"
:filter-option="filterOption"> :filter-option="filterOption">
<a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{ <a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{ item.realname }}</a-select-option>
item.realname
}}
</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -98,7 +95,7 @@
:disabled-charge-company="true" :disabled-charge-company="true"
:default-charge-way="2" :default-charge-way="2"
:is-contract-num-disabled="true" :is-contract-num-disabled="true"
@ok="modalFormOk"></general-project-module> @ok="selectProjectOk"></general-project-module>
</j-modal> </j-modal>
</template> </template>
@@ -310,6 +307,7 @@ export default {
}, },
handleCancel() { handleCancel() {
this.close() this.close()
this.$emit('ok')
}, },
/** /**
* 打开新增module * 打开新增module
@@ -346,9 +344,21 @@ export default {
*/ */
searchReset() { searchReset() {
this.lastQueryParam = {} this.lastQueryParam = {}
this.queryParam.departId = this.departId let obj = {
departId: this.departId,
principalId: undefined,
year: undefined,
}
this.queryParam = Object.assign(this.queryParam, obj)
this.loadData(1) this.loadData(1)
}, },
/**
* 新建项目完成后关闭两个模态框
*/
selectProjectOk() {
this.close()
this.$emit('ok')
}
} }
} }
</script> </script>
+264
View File
@@ -0,0 +1,264 @@
<template>
<a-card :bordered="false">
<a-form :form="form" class="form-box">
<a-form-item label="频率" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
v-decorator="['deptFrequency', validatorRules.deptFrequency]"
:triggerChange="true"
placeholder="请选择频率"
dictCode="system_dept_frequency"
@change="deptFrequencyChange"/>
</a-form-item>
<a-form-item label="催款时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- 仅此一次(年月日)-->
<j-date
v-if="selectDeptFrequency === '1'"
placeholder="请选择催款时间"
style="width: 100%;"
v-decorator="['deptTime', validatorRules.deptTime]"
:trigger-change="true"
date-format="YYYY-MM-DD"/>
<!-- 每年一次(月日)-->
<div class="m-d">
<!-- 月-->
<template v-if="selectDeptFrequency === '2'">
<a-select
class="select-month"
placeholder="请选择月"
@change="handleChange"
v-decorator="['deptMonth', validatorRules.deptMonth]"
:options="monthOptions">
</a-select>
</template>
<!-- 日-->
<template v-if="selectDeptFrequency === '2' || selectDeptFrequency === '3'">
<a-select
style="width: calc(50% - 8px)"
placeholder="请选择日"
@change="handleChange"
v-decorator="['deptDay', validatorRules.deptDay]"
:options="dayOptions">
</a-select>
</template>
</div>
</a-form-item>
<a-form-item class="btn-form">
<a-button type="primary" class="btn-form-save">保存</a-button>
<a-button class="btn-form-cancel">取消</a-button>
</a-form-item>
</a-form>
</a-card>
</template>
<script>
import JDate from '../../components/tools/JDate'
export default {
name: 'SystemDept',
components: { JDate },
data() {
return {
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 21 }
},
validatorRules: {
deptFrequency: {
rules: [{ required: true, message: '请选择频率' }],
validateTrigger: 'change'
},
deptTime: {
rules: [{ required: true, message: '请选择催款时间' }],
validateTrigger: 'change'
},
deptMonth: {
rules: [{ required: true, message: '请选择月' }],
validateTrigger: 'change'
},
deptDay: {
rules: [{ required: true, message: '请选择日' }],
validateTrigger: 'change'
}
},
selectDeptFrequency: '1', // 选中的提示频率
monthOptions: [
{
value: 1,
label: 1
}, {
value: 2,
label: 2
}, {
value: 3,
label: 3
}, {
value: 4,
label: 4
}, {
value: 5,
label: 5
}, {
value: 6,
label: 6
}, {
value: 7,
label: 7
}, {
value: 8,
label: 8
}, {
value: 9,
label: 9
}, {
value: 10,
label: 10
}, {
value: 11,
label: 11
}, {
value: 12,
label: 12
}
],
dayOptions: [
{
value: 1,
label: 1
}, {
value: 2,
label: 2
}, {
value: 3,
label: 3
}, {
value: 4,
label: 4
}, {
value: 5,
label: 5
}, {
value: 6,
label: 6
}, {
value: 7,
label: 7
}, {
value: 8,
label: 8
}, {
value: 9,
label: 9
}, {
value: 10,
label: 10
}, {
value: 11,
label: 11
}, {
value: 12,
label: 12
}, {
value: 13,
label: 13
}, {
value: 14,
label: 14
}, {
value: 15,
label: 15
}, {
value: 16,
label: 16
}, {
value: 17,
label: 17
}, {
value: 18,
label: 18
}, {
value: 19,
label: 19
}, {
value: 20,
label: 20
}, {
value: 21,
label: 21
}, {
value: 22,
label: 22
}, {
value: 23,
label: 23
}, {
value: 24,
label: 24
}, {
value: 25,
label: 25
}, {
value: 26,
label: 26
}, {
value: 27,
label: 27
}, {
value: 28,
label: 28
}, {
value: 29,
label: 29
}, {
value: 30,
label: 30
}
]
}
},
methods: {
deptFrequencyChange(value) {
this.selectDeptFrequency = value || '1'
console.log(typeof this.selectDeptFrequency, this.selectDeptFrequency)
},
handleChange() {
}
}
}
</script>
<style scoped lang="less">
.form-box {
min-height: 500px;
width: 60%;
}
.select-month {
margin-right: 16px;
width: calc(50% - 8px);
}
.btn-form {
display: flex;
justify-content: center;
&-save {
margin-right: 10px;
}
&-cancel {
margin-left: 10px;
}
}
</style>