【update】-编辑合同编号功能
This commit is contained in:
@@ -161,15 +161,14 @@ export default {
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.onClearSelected()
|
||||
this.visible = false
|
||||
this.selectedCompany = {}
|
||||
if (this.isMultiple) {
|
||||
this.selectedCompany = []
|
||||
}
|
||||
this.onClearSelected()
|
||||
},
|
||||
onSelectChange(selectedRowKeys, selectionRows) {
|
||||
console.log('---this.selectedCompany----', selectedRowKeys, selectionRows)
|
||||
if(!this.isMultiple) {
|
||||
this.selectedCompany = selectionRows[0]
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
<div class="company-select">
|
||||
<a-row>
|
||||
<a-col :span="20">
|
||||
<a-input @click="chooseBusiness" :title="value[valueKey]" :value="value[valueKey]" v-bind="$attrs" :readOnly="true" unselectable="on"></a-input>
|
||||
<a-tooltip v-if="isMultiple">
|
||||
<template slot="title">{{ value[valueKey] }}</template>
|
||||
<a-input @click="chooseBusiness" :value="value[valueKey]" v-bind="$attrs" :readOnly="true" unselectable="on"></a-input>
|
||||
</a-tooltip>
|
||||
<a-input v-else @click="chooseBusiness" :value="value[valueKey]" v-bind="$attrs" :readOnly="true" unselectable="on"></a-input>
|
||||
</a-col>
|
||||
<a-col :span="4" class="form-btn" v-if="canAdd">
|
||||
<a-button v-bind="$attrs" icon="plus" @click="addCompany"></a-button>
|
||||
@@ -70,7 +74,18 @@ export default {
|
||||
this.$refs.businessSelect.isLimit = this.isLimit
|
||||
this.$refs.businessSelect.searchReset()
|
||||
this.$refs.businessSelect.visible = true
|
||||
this.$refs.businessSelect.selectedRowKeys[0] = this.value.id
|
||||
if (!this.isMultiple) {
|
||||
this.$refs.businessSelect.selectedRowKeys[0] = this.value.id
|
||||
} else {
|
||||
// 很重要 内部的删除像没有作用一样
|
||||
if(this.value.id) {
|
||||
this.$refs.businessSelect.selectedRowKeys = this.value.id.split(',')
|
||||
this.$refs.businessSelect.selectedCompany = this.multipleData || []
|
||||
} else {
|
||||
this.$refs.businessSelect.selectedRowKeys = []
|
||||
this.$refs.businessSelect.selectedCompany = []
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 选中后抛出企业信息(id, companyName)
|
||||
@@ -90,6 +105,8 @@ export default {
|
||||
company.id = ids.join()
|
||||
company.companyName= nameArr.join()
|
||||
}
|
||||
// 存储上次选中的信息,用于回显
|
||||
this.multipleData = value
|
||||
} else {
|
||||
company.id = value.id
|
||||
company.companyName= value.companyName
|
||||
|
||||
@@ -157,12 +157,14 @@
|
||||
<a v-if="record.status === 3 || record.status === 5" @click="handleCancellation(record)"
|
||||
v-has="'revenueContract:cancellation'">作废</a>
|
||||
<a v-if="record.postStatus === 1" @click="handleReviewMailDetail(record)" v-has="'revenueContract:mailDetail'">查看邮寄详情</a>
|
||||
<a @click="handleEditContractNum(record)" v-has="'revenueContract:editContractNum'">修改合同编号</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
</a-card>
|
||||
<revenue-contract-aduit-module ref="aduitForm" @ok="modalFormOk"></revenue-contract-aduit-module>
|
||||
<mail-detail-modal ref="mailDetail" @ok="modalFormOk"></mail-detail-modal>
|
||||
<revenue-contract-edit-num ref="revenueContractEditNum" @ok="contractEditNumOk"></revenue-contract-edit-num>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -176,10 +178,11 @@ import { RangeDateMixin } from '../../../mixins/RangeDateMixin'
|
||||
import { archiveRevenueContract, cancellationContract } from '../../../api/incomePaymentsApi'
|
||||
import JYearDate from '../../../components/jero/JYearDate'
|
||||
import MailDetailModal from '../modules/MailDetailModal'
|
||||
import RevenueContractEditNum from './modules/RevenueContractEditNum'
|
||||
|
||||
export default {
|
||||
name: 'RevenueContractList',
|
||||
components: { PageHeaderTitle, RevenueContractAduitModule, JDate, JYearDate, MailDetailModal },
|
||||
components: { PageHeaderTitle, RevenueContractAduitModule, JDate, JYearDate, MailDetailModal, RevenueContractEditNum },
|
||||
mixins: [JeroListMixin, RangeDateMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -282,7 +285,7 @@ export default {
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 220,
|
||||
width: 320,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
@@ -415,6 +418,16 @@ export default {
|
||||
*/
|
||||
handleReviewMailDetail(record) {
|
||||
this.$refs.mailDetail.open(record)
|
||||
},
|
||||
/**
|
||||
* 编辑合同编号
|
||||
* @param record
|
||||
*/
|
||||
handleEditContractNum(record) {
|
||||
this.$refs.revenueContractEditNum.open(record)
|
||||
},
|
||||
contractEditNumOk() {
|
||||
this.loadData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
<!--编辑合同编号-->
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row :gutter="24">
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="合同编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入合同编号"
|
||||
v-decorator="['contractNum',validatorRules.contractNum]"
|
||||
:maxLength='50'
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<template slot="footer">
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import {httpAction} from '@api/manage'
|
||||
// import { duplicateCheck } from '../../../../api/api'
|
||||
|
||||
export default {
|
||||
name: 'RevenueContractEditNum',
|
||||
data() {
|
||||
return {
|
||||
title: '修改合同编号',
|
||||
width: 800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: {span: 24},
|
||||
sm: {span: 6}
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: {span: 24},
|
||||
sm: {span: 18}
|
||||
},
|
||||
url: {
|
||||
edit: '/contract/payIncomeContract/editContractNum'
|
||||
},
|
||||
validatorRules: {
|
||||
contractNum: {
|
||||
rules: [{ required: true, validator: this.checkContractNum }],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 合同编号唯一性校验
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkContractNum(rules, value, callback) {
|
||||
if (value) {
|
||||
// const params = {
|
||||
// confusionCode: 'pay_contract_num',
|
||||
// fieldVal: value
|
||||
// }
|
||||
// duplicateCheck(params).then(res => {
|
||||
// if (res.success) {
|
||||
// callback()
|
||||
// } else {
|
||||
// callback('合同编号已存在')
|
||||
// }
|
||||
// })
|
||||
callback()
|
||||
} else {
|
||||
callback('请输入合同编号')
|
||||
}
|
||||
},
|
||||
open(record) {
|
||||
console.log(record, 'addMeetingPerson')
|
||||
this.form.resetFields()
|
||||
this.visible = true
|
||||
this.model = Object.assign({}, record)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'contractNum'))
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.visible = false
|
||||
},
|
||||
handleOk() {
|
||||
const that = this
|
||||
if(this.confirmLoading) return
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true
|
||||
let method = 'post'
|
||||
let url = this.url.edit
|
||||
const formData = Object.assign({}, values)
|
||||
// 合同id
|
||||
formData.id = this.model.id
|
||||
httpAction(url, formData, method).then(res => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
that.handleCancel()
|
||||
that.confirmLoading = false
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user