|
@@ -128,6 +128,7 @@ import {ref,watch,nextTick} from "vue";
|
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
|
import HTableForm from "~src/plugins/HTableForm"
|
|
|
import wbsApi from "~api/data-fill/wbs"
|
|
|
+import {getDapSiteData} from "~api/other"
|
|
|
import HcUpload from "./HcUpload.vue"
|
|
|
import {utilsText, isType, formValidate,deepClone} from "vue-utils-plus"
|
|
|
|
|
@@ -149,6 +150,10 @@ const props = defineProps({
|
|
|
type: [String,Number],
|
|
|
default: ''
|
|
|
},
|
|
|
+ contractId: {
|
|
|
+ type: [String,Number],
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
})
|
|
|
const {isString, getObjNullValue, getArrValue} = isType()
|
|
|
const {setPosInsert, setPosRange} = utilsText()
|
|
@@ -156,16 +161,19 @@ const listDatas = ref(props.datas)
|
|
|
const classify = ref(props.classify)
|
|
|
const isStatus = ref(props.status)
|
|
|
const isPrimaryKeyId = ref(props.primaryKeyId)
|
|
|
+const contractId = ref(props.contractId)
|
|
|
|
|
|
//监听
|
|
|
watch(() => [
|
|
|
props.datas,
|
|
|
props.classify,
|
|
|
props.primaryKeyId,
|
|
|
-], ([datas, classifyVal, primaryKeyId]) => {
|
|
|
+ props.contractId,
|
|
|
+], ([datas, classifyVal, primaryKeyId, cid]) => {
|
|
|
listDatas.value = datas
|
|
|
classify.value = classifyVal
|
|
|
isPrimaryKeyId.value = primaryKeyId
|
|
|
+ contractId.value = cid
|
|
|
setFormDataNum(datas)
|
|
|
})
|
|
|
|
|
@@ -250,7 +258,10 @@ const getExcelHtml = async (item,index) => {
|
|
|
//表单正则效验
|
|
|
onBlur: (event, key, reg, val, msg) => {
|
|
|
setTableFormBlurReg(pkeyIds, event, key, reg, val, msg, item, index)
|
|
|
- }
|
|
|
+ },
|
|
|
+ onRemote: async (query, key, type) => {
|
|
|
+ return await setTableFormRemoteMethod(pkeyIds, query, key, type)
|
|
|
+ },
|
|
|
})
|
|
|
item.isTableFormRender = true
|
|
|
item.isRenderTableForm = true
|
|
@@ -286,6 +297,36 @@ const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index) =>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//获取下拉框测站点筛选数据
|
|
|
+const setTableFormRemoteMethod = async (pkeyId, query, key, type) => {
|
|
|
+ if (type === 'dap_site_data') {
|
|
|
+ return await setFormRemoteDapSiteData(pkeyId, query, key, type)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//处理数据
|
|
|
+const dap_site_data = ref([]);
|
|
|
+const setFormRemoteDapSiteData = async (pkeyId, query, key, type) => {
|
|
|
+ const datas = await getDapSiteDataApi(pkeyId, query, key, type)
|
|
|
+ console.log(datas)
|
|
|
+}
|
|
|
+
|
|
|
+//获取数据源
|
|
|
+const getDapSiteDataApi = async (pkeyId, query, key, type) => {
|
|
|
+ const datas = dap_site_data.value
|
|
|
+ if (datas.length > 0) {
|
|
|
+ return datas
|
|
|
+ } else {
|
|
|
+ const {error, code, data} = await getDapSiteData({
|
|
|
+ contractId: contractId.value,
|
|
|
+ pkId: pkeyId,
|
|
|
+ key: key
|
|
|
+ }, false)
|
|
|
+
|
|
|
+ console.log(data)
|
|
|
+ return []
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
//获取已填写的数据
|
|
|
const getBussDataInfo = async (item,pkeyId, index) => {
|