这是我自己写的
<el-table-column label=" 约定账期" align="center" prop="appointPayment" width="120">
<template slot-scope="scope">
<span>{{ getClientName(scope.row) }}</span>
</template>
<el-form-item label="约定账期" prop="appointPaymemt" >
<el-select v-model="form.appointPayment" filterable placeholder="请选择约定账期" style="width: 100%;">
<el-option
v-for="dict in appointpaymentOptions.filter(p=>typeof p.clientName!== 'undefined' && p.clientName.includes(form.clientName))"
:key="dict.id"
:label="dict.appointpayment"
:value="dict.id"
></el-option>
</el-select>
</el-form-item>
import {listBasics} from "@/api/system/basics";
created() {
listBasics({pageSize: 999999}).then(response => {
this.appointpaymentOptions= response.rows;
console.log(response);
})
}
methods: {
getClientName(row) {
let yz= this.appointPaymentOptions.filter(p => p.id+'' === row.appointPayment).pop();
if (typeof yz === "undefined") return "";
return yz.appoinPayment;
},
}
我想要达到的结果
根据选择的客户而选择约定账期,数据来自另外一张表格里面,客户选择已经实现了,约定账期和客户的数据是来自同一张表格里面的