[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'
},
contractName: {
rules: [{ required: true, validator: this.checkContractName }],
rules: [{ required: true, message:'请输入合同名称' }],
validateTrigger: 'blur'
},
signedCompany: {
@@ -440,33 +440,33 @@ export default {
callback('请输入合同编号')
}
},
/**
* 合同名称唯一性校验
* @param rules
* @param value
* @param callback
*/
checkContractName(rules, value, callback) {
if (value) {
if (!this.model.id) {
const params = {
confusionCode: 'pay_spending_contract_name',
fieldVal: value
}
duplicateCheck(params).then(res => {
if (res.success) {
callback()
} else {
callback('合同名称已存在')
}
})
return
}
callback()
} else {
callback('请输入合同名称')
}
},
// /**
// * 合同名称唯一性校验
// * @param rules
// * @param value
// * @param callback
// */
// checkContractName(rules, value, callback) {
// if (value) {
// if (!this.model.id) {
// const params = {
// confusionCode: 'pay_spending_contract_name',
// fieldVal: value
// }
// duplicateCheck(params).then(res => {
// if (res.success) {
// callback()
// } else {
// callback('合同名称已存在')
// }
// })
// return
// }
// callback()
// } else {
// callback('请输入合同名称')
// }
// },
/**
* 选中企业变化
* @param value
@@ -93,17 +93,17 @@
@click="toRevenueContractDetail(record.id, record.contractNum)"
v-if="record.chargeStatus === 1"
:value="text"
:length="20"></j-ellipsis>
:length="18"></j-ellipsis>
<j-ellipsis
class="primary-color"
@click="toRevenueContractDetail(record.id)"
v-else
:value="text"
:length="20"></j-ellipsis>
:length="18"></j-ellipsis>
</template>
<template slot="text" slot-scope="text">
<j-ellipsis :value="text" :length="20"></j-ellipsis>
<j-ellipsis :value="text" :length="18"></j-ellipsis>
</template>
<span slot="action" class="action-span-cell" slot-scope="text, record">
@@ -256,7 +256,7 @@
<select-project-module ref="selectProjectModule"
@ok="selectProjectOk"
:depart-id="departId"
:pack="model.pack"
:pack="Number(model.pack)"
:contract-id="model.id"
:project-type="projectType"
:default-contract-num="contractNum"
@@ -31,10 +31,7 @@
placeholder="请选择负责人"
option-filter-prop="children"
:filter-option="filterOption">
<a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{
item.realname
}}
</a-select-option>
<a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{ item.realname }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
@@ -98,7 +95,7 @@
:disabled-charge-company="true"
:default-charge-way="2"
:is-contract-num-disabled="true"
@ok="modalFormOk"></general-project-module>
@ok="selectProjectOk"></general-project-module>
</j-modal>
</template>
@@ -310,6 +307,7 @@ export default {
},
handleCancel() {
this.close()
this.$emit('ok')
},
/**
* 打开新增module
@@ -346,9 +344,21 @@ export default {
*/
searchReset() {
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)
},
/**
* 新建项目完成后关闭两个模态框
*/
selectProjectOk() {
this.close()
this.$emit('ok')
}
}
}
</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>