|
@@ -189,20 +189,20 @@ const searchForm = ref({
|
|
|
|
|
|
//获取合同段列表
|
|
|
const getContractOpt = async () => {
|
|
|
- const { error, code, data } = await getContractList({
|
|
|
+ const { data } = await getContractList({
|
|
|
contractId: contractId.value,
|
|
|
projectId: projectId.value,
|
|
|
})
|
|
|
- //判断状态
|
|
|
- if (!error && code === 200) {
|
|
|
- let resdata = getArrValue(data)
|
|
|
- contractOptions.value = resdata
|
|
|
- if (contractOptions.value.length > 0) {
|
|
|
- searchForm.value.contractId = contractOptions.value[0].id
|
|
|
+ const res = getArrValue(data)
|
|
|
+ contractOptions.value = res
|
|
|
+ if (res.length <= 0) return
|
|
|
+ let cid
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
+ if (contractId.value == res[i].id) {
|
|
|
+ cid = res[i].id
|
|
|
}
|
|
|
- } else {
|
|
|
- contractOptions.value = []
|
|
|
}
|
|
|
+ searchForm.value.contractId = isNullES(cid) ? res[0].id : cid
|
|
|
}
|
|
|
|
|
|
//获取汇总分类列表
|