|
@@ -154,7 +154,6 @@ const dateCalendarChoice = ({date, choices}) => {
|
|
|
getExcelHtml(excelIdVal.value)
|
|
|
getTheLogBusinessData(excelIdVal.value, choices)
|
|
|
getSubmitLogDateList(date,primaryKeyId)
|
|
|
- queryCurrentLogSelectProcessList(choices)
|
|
|
}
|
|
|
|
|
|
//获取模板标签数据
|
|
@@ -171,7 +170,7 @@ const getExcelHtml = async (excelId) => {
|
|
|
const resData = isString(data) ? data || '' : ''
|
|
|
excelHtmlData.value = resData
|
|
|
if (!error && code === 200 && resData) {
|
|
|
- setHTableForm(resData,excelId,tableFormData.value)
|
|
|
+ setHTableForm(resData,excelId)
|
|
|
} else {
|
|
|
isTableForm.value = false
|
|
|
statusDesc.value = '暂无表单'
|
|
@@ -185,17 +184,17 @@ const getExcelHtml = async (excelId) => {
|
|
|
|
|
|
//渲染表单
|
|
|
const tableFormApp = ref(null)
|
|
|
-const setHTableForm = async (resData, excelId, info) => {
|
|
|
+const setHTableForm = (resData, excelId) => {
|
|
|
//先卸载
|
|
|
if (tableFormApp.value) {
|
|
|
tableFormApp.value?.unmount()
|
|
|
}
|
|
|
if (resData) {
|
|
|
isTableForm.value = true
|
|
|
- await nextTick(() => {
|
|
|
+ nextTick(() => {
|
|
|
tableFormApp.value = HTableForm.createForm({
|
|
|
template: resData,
|
|
|
- tableForm: info,
|
|
|
+ tableForm: tableFormData.value,
|
|
|
appId: `#table-form-${excelId}`
|
|
|
})
|
|
|
})
|
|
@@ -219,10 +218,15 @@ const getTheLogBusinessData = async (excelId, recordDate) => {
|
|
|
}, false)
|
|
|
//设置默认数据
|
|
|
let formArrData = getArrValue(data)
|
|
|
- for (let i = 0; i < formArrData.length; i++) {
|
|
|
- formArrData[i] = setFormDefaultData(formArrData[i])
|
|
|
+ if (formArrData.length > 0) {
|
|
|
+ for (let i = 0; i < formArrData.length; i++) {
|
|
|
+ formArrData[i] = setFormDefaultData(formArrData[i])
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ formArrData = [setFormDefaultData()]
|
|
|
}
|
|
|
formLogDataList.value = formArrData
|
|
|
+ console.log(formArrData)
|
|
|
getBussDataInfo()
|
|
|
}
|
|
|
|
|
@@ -234,13 +238,15 @@ const getBussDataInfo = (index = 0) => {
|
|
|
const info = getObjValue(formLog[index])
|
|
|
formLogIndex.value = index
|
|
|
if (getObjNullValue(info)) {
|
|
|
- tableFormData.value = HTableForm.setPickerKey(info)
|
|
|
+ HTableForm.setPickerKey(info)
|
|
|
+ tableFormData.value = info
|
|
|
} else {
|
|
|
tableFormData.value = {}
|
|
|
}
|
|
|
if (excelHtmlData.value) {
|
|
|
- setHTableForm(excelHtmlData.value, excelIdVal.value, tableFormData.value)
|
|
|
+ setHTableForm(excelHtmlData.value, excelIdVal.value)
|
|
|
}
|
|
|
+ queryCurrentLogSelectProcessList(info?.id ?? '')
|
|
|
}
|
|
|
|
|
|
//获取日期记录
|
|
@@ -309,8 +315,11 @@ const ElTreeLoadNode = async (node, resolve) => {
|
|
|
//确认关联工序
|
|
|
const processDataList = ref([])
|
|
|
const processNodeClick = () => {
|
|
|
- const keys = processElTree.value.getCheckedKeys();
|
|
|
- //formLogDataList.value = formArrData
|
|
|
+ const keys = processElTree.value.getCheckedKeys()
|
|
|
+ const formIndex = formLogIndex.value
|
|
|
+ const formData = formLogDataList.value[formIndex]
|
|
|
+ const linkTabIds = formData['']
|
|
|
+
|
|
|
let NodesArr = []
|
|
|
for (let index = 0; index < keys.length; index++) {
|
|
|
let pathArr = [];
|
|
@@ -322,6 +331,10 @@ const processNodeClick = () => {
|
|
|
primaryKeyId: keys[index],
|
|
|
pathName: pathArr.join('/')
|
|
|
})
|
|
|
+ /*linkTabIds.push({
|
|
|
+ path: item['pathName'],
|
|
|
+ primaryKeyId: item['primaryKeyId']
|
|
|
+ });*/
|
|
|
}
|
|
|
processDataList.value = NodesArr
|
|
|
processNodeModal.value = false
|
|
@@ -353,6 +366,7 @@ const tableFormSaveClick = async () => {
|
|
|
|
|
|
//保存
|
|
|
const saveExcelBussData = async () => {
|
|
|
+ console.log(formLogDataList.value)
|
|
|
let linkTabIds = setProcessData(); //处理工序ID
|
|
|
if (linkTabIds) {
|
|
|
tableFormSaveLoading.value = true
|
|
@@ -421,13 +435,10 @@ const getBussPdfInfo = async () => {
|
|
|
}
|
|
|
|
|
|
//获取当前日志资料关联的工序节点信息
|
|
|
-const queryCurrentLogSelectProcessList = async (dateVal) => {
|
|
|
- const {primaryKeyId} = menuItem.value
|
|
|
+const queryCurrentLogSelectProcessList = async (bid) => {
|
|
|
const { error, code, data, msg } = await queryApi.queryCurrentLogSelectProcessList({
|
|
|
contractId: contractId.value || '',
|
|
|
- nodePrimaryKeyId: primaryKeyId,
|
|
|
- recordTime: dateVal,
|
|
|
- theLogId: ""
|
|
|
+ businessId: bid ?? ''
|
|
|
}, false)
|
|
|
//处理数据
|
|
|
if (!error && code === 200) {
|
|
@@ -495,7 +506,7 @@ const copyTimeSaveClick = async () => {
|
|
|
}
|
|
|
|
|
|
//设置表单默认数据
|
|
|
-const setFormDefaultData = (formInfo) => {
|
|
|
+const setFormDefaultData = (formInfo = {}) => {
|
|
|
return {
|
|
|
linkTabIds: [],
|
|
|
...formInfo,
|