|
@@ -64,7 +64,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, watch } from 'vue'
|
|
import { ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
-import { formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
|
|
|
+import { formValidate, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
import mainApi from '~api/tentative/detect/commission'
|
|
import mainApi from '~api/tentative/detect/commission'
|
|
import samplingApi from '~api/tentative/material/sampling'
|
|
import samplingApi from '~api/tentative/material/sampling'
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
@@ -75,6 +75,10 @@ const props = defineProps({
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
default: '',
|
|
default: '',
|
|
},
|
|
},
|
|
|
|
+ cid: {
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: '',
|
|
|
|
+ },
|
|
})
|
|
})
|
|
const emit = defineEmits(['change', 'close'])
|
|
const emit = defineEmits(['change', 'close'])
|
|
//变量
|
|
//变量
|
|
@@ -111,7 +115,10 @@ const getContractData = async () => {
|
|
})
|
|
})
|
|
const res = getArrValue(data)
|
|
const res = getArrValue(data)
|
|
contractData.value = res
|
|
contractData.value = res
|
|
- if (res.length > 0) {
|
|
|
|
|
|
+ if (!isNullES(props.cid)) {
|
|
|
|
+ searchForm.value.contractId = props.cid
|
|
|
|
+ }
|
|
|
|
+ if (isNullES(props.cid) && res.length > 0) {
|
|
searchForm.value.contractId = res[0].id
|
|
searchForm.value.contractId = res[0].id
|
|
}
|
|
}
|
|
}
|
|
}
|