You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
5.4 KiB

3 years ago
<template>
<div>
<xy-dialog
3 years ago
:width="74"
3 years ago
ref="dialog"
:is-show.sync="isShow"
type="form"
3 years ago
:title="type === 'add' ? '新增收款单' : '编辑收款单'"
3 years ago
:form="form"
:rules="rules"
@submit="submit">
3 years ago
<template v-slot:pay_name>
3 years ago
<div class="xy-table-item">
<div class="xy-table-item-label">
3 years ago
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>付款方
3 years ago
</div>
<div class="xy-table-item-content">
3 years ago
<el-input v-model="form.pay_name" clearable placeholder="请输入付款方" style="width: 300px;"></el-input>
3 years ago
</div>
</div>
</template>
3 years ago
<template v-slot:money>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>金额
</div>
<div class="xy-table-item-content">
<el-input-number :controls="false" :precision="2" v-model="form.money" clearable placeholder="请输入金额" style="width: 300px;"></el-input-number>
</div>
</div>
</template>
<template v-slot:invoice_type>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发票类型
</div>
<div class="xy-table-item-content">
<el-select v-model="form.invoice_type" style="width: 300px" placeholder="请选择发票类型">
<el-option v-for="item in [{label:'无',value:0},{label:'服务类发票',value:1}]" :label="item.label" :value="item.value" :key="item.value"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:date >
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>收款单日期
</div>
<div class="xy-table-item-content">
<el-date-picker
placeholder="请选择收款单日期"
value-format="yyyy-MM-dd"
v-model="form.date"
style="width: 300px;"></el-date-picker>
</div>
</div>
</template>
<template v-slot:status >
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>付款状态
</div>
<div class="xy-table-item-content">
<el-select v-model="form.status " style="width: 300px" placeholder="请选择付款状态">
<el-option v-for="item in [{label:'未付款',value:0},{label:'部分付款',value:1},{label:'已付清',value:2}]" :label="item.label" :value="item.value" :key="item.value"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:schedule_links >
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>排班信息
</div>
<div class="xy-table-item-content">
3 years ago
<div class="xy-table-item-content-schedule" @click="$refs['scheduleList'].isShow = true">
3 years ago
<template v-if="form.schedule_links.length > 0">
3 years ago
3 years ago
</template>
<template v-else>
请选择排班
</template>
</div>
3 years ago
</div>
</div>
</template>
3 years ago
</xy-dialog>
3 years ago
<scheduleList ref="scheduleList"></scheduleList>
3 years ago
</div>
</template>
<script>
import {save,getForm} from '@/api/collectMoney'
3 years ago
import scheduleList from "@/views/finance/component/scheduleList";
3 years ago
export default {
3 years ago
components:{
scheduleList
},
3 years ago
data() {
return {
isShow:false,
id:'',
type:'',
form:{
3 years ago
pay_name:'',
money:'',
invoice_type:'',
date:'',
status:'',
3 years ago
schedule_links:[],
3 years ago
},
rules:{
3 years ago
pay_name:[
{required:true,message:'请填写付款方'}
3 years ago
]
}
}
},
methods: {
3 years ago
3 years ago
async getDetail(){
const res = await getForm(this.id)
this.$integrateData(this.form,res)
},
submit(){
if(this.type === 'editor'){
Object.defineProperty(this.form,'id',{
value:this.id,
enumerable:true,
configurable:true,
writable:true
})
}
save(this.form).then(res => {
this.$successMessage(this.type,'')
this.isShow = false
this.$emit('refresh')
})
}
},
watch:{
isShow(val){
if(val){
if(this.type === 'editor'){
this.getDetail()
}
}else{
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
delete this.form.id
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner{
text-align: left;
}
3 years ago
.xy-table-item-content-schedule{
color: #C0C4CC;;
width: 300px;
height: 40px;
line-height: 40px;
background-color: #FFFFFF;
border-radius: 4px;
border: 1px solid #DCDFE6;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
padding: 0 15px;
&:hover{
border: 1px solid #C0C4CC;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}
}
3 years ago
</style>