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

@ -245,7 +245,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>项目名称
</div> </div>
<div class="xy-table-item-content"> <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>
</div> </div>
</template> </template>
@ -433,7 +433,8 @@
import { import {
getContract, getContract,
addContrant, addContrant,
delContract delContract,
checkContractName
} from "@/api/contract/contract" } from "@/api/contract/contract"
import { import {
getparameter getparameter
@ -931,7 +932,13 @@
return m2 == 0 ? m1 : m2; 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() { confirmPlanForSearch() {
this.isShowPlanForSearch = false; this.isShowPlanForSearch = false;

Loading…
Cancel
Save