刘翔宇-旅管家 3 years ago
parent 4e38f1beea
commit 47ec6798ad

@ -40,3 +40,10 @@ export function editorContract(data){
})
}
export function checkContractName(params){
return request({
method:'get',
url:'/api/admin/contract/check-name',
params
})
}

@ -10,7 +10,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写项目名称" v-model="detail.name" style="width: 300px;" />
<el-input clearable placeholder="请填写项目名称" @change="checkName" v-model="detail.name" style="width: 300px;" />
</div>
</div>
</template>
@ -198,7 +198,8 @@
<script>
import {
editorContract,
detailContract
detailContract,
checkContractName
} from "@/api/contract/contract";
import {
getBudget
@ -379,9 +380,9 @@
//
selectPlan(sel, row) {
if (sel) {
let select=sel.map(item => {
if (sel) {
let select = sel.map(item => {
return {
label: item.name,
value: {
@ -390,9 +391,9 @@
new_money: item.money
}
}
})
})
this.plan = [...this.detail.plan,...select]
this.plan = [...this.detail.plan, ...select]
} else {
this.plan = this.detail.plan;
}
@ -413,10 +414,10 @@
})
this.plans = res.list.data
this.planTotal = res.list.total
var selPlans = [...this.detail.plan,...this.plan]
//let selPlans = this.detail.plan.contact([]);
var selPlans = [...this.detail.plan, ...this.plan]
//let selPlans = this.detail.plan.contact([]);
console.log(selPlans)
this.toggleSelection(selPlans.map(item => {
return item.value.plan_id
@ -427,8 +428,8 @@
this.getBudgets()
},
//
toggleSelection(plans) {
var selPlans = [...this.detail.plan,...this.plan]
toggleSelection(plans) {
var selPlans = [...this.detail.plan, ...this.plan]
if (plans) {
this.plans.filter(plan => {
if (plans.includes(plan.id)) {
@ -476,6 +477,10 @@
})
}
this.plan = this.detail.plan
},
//y
checkName(e) {
},
editor() {
editorContract({

@ -245,7 +245,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请填写项目名称" style="width: 300px;" />
<el-input v-model="form.name" @change="checkName" placeholder="请填写项目名称" style="width: 300px;" />
</div>
</div>
</template>
@ -433,7 +433,8 @@
import {
getContract,
addContrant,
delContract
delContract,
checkContractName
} from "@/api/contract/contract"
import {
getparameter
@ -931,7 +932,13 @@
return m2 == 0 ? m1 : m2;
}
}
},
{
label: "已用金额",
prop: 'use_money_total',
width: 120,
align: 'right'
},
],
@ -1194,6 +1201,12 @@
}
}
}
},
//y
checkName(e){
checkContractName({name:e}).then(res=>{
console.log(res);
})
},
confirmPlanForSearch() {
this.isShowPlanForSearch = false;

Loading…
Cancel
Save