|
@@ -6,6 +6,16 @@
|
|
|
<div class="hc-excel-table-form-view" :id="`table-form-${excelIdVal}`"></div>
|
|
|
</el-scrollbar>
|
|
|
<HcStatus :desc="statusDesc" v-else/>
|
|
|
+ <div class="hc-fixed-page" v-if="formLogDataList.length > 1">
|
|
|
+ <el-scrollbar>
|
|
|
+ <template v-for="(item,index) in formLogDataList">
|
|
|
+ <el-button :type="index === formLogIndex ? 'primary' : ''" hc-btn @click="getBussDataInfo(index)">
|
|
|
+ <HcIcon name="sticky-note"/>
|
|
|
+ <span>第{{index + 1}}页</span>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="hc-right-pian-box hc-flex-column">
|
|
|
<DateCalendar :dateData="dateData" @choice-date="dateCalendarChoice"/>
|
|
@@ -46,7 +56,7 @@
|
|
|
</el-button>
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="ledger_query_copy_form">
|
|
|
- <el-button hc-btn :disabled="!isTableForm">
|
|
|
+ <el-button hc-btn :disabled="!isTableForm" @click="copyTableFormClick">
|
|
|
<HcIcon name="file-copy-2"/>
|
|
|
<span>复制当前表格及内容</span>
|
|
|
</el-button>
|
|
@@ -58,7 +68,7 @@
|
|
|
</el-button>
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="ledger_query_add_form">
|
|
|
- <el-button hc-btn :disabled="!isTableForm">
|
|
|
+ <el-button hc-btn :disabled="!isTableForm" @click="addTableFormClick">
|
|
|
<HcIcon name="add-circle"/>
|
|
|
<span>新增表格</span>
|
|
|
</el-button>
|
|
@@ -148,17 +158,19 @@ const getSubmitLogDateList = async (pid) => {
|
|
|
dateData.value = []
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//日期日历回调
|
|
|
const recordTime = ref('')
|
|
|
const dateCalendarChoice = ({choices}) => {
|
|
|
recordTime.value = choices
|
|
|
+ queryCurrentLogSelectProcessList(choices)
|
|
|
+ getTheLogBusinessData(excelIdVal.value, choices)
|
|
|
}
|
|
|
|
|
|
//表格表单渲染
|
|
|
const isTableForm = ref(false)
|
|
|
const getExcelHtmlData = async (excelId) => {
|
|
|
if (excelId) {
|
|
|
- getBussDataInfo(excelId)
|
|
|
getExcelHtml(excelId)
|
|
|
} else {
|
|
|
statusDesc.value = `excelId: ${excelId || '-1 或 空'}`
|
|
@@ -166,33 +178,52 @@ const getExcelHtmlData = async (excelId) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//表单数据
|
|
|
+const formLogDataList = ref([])
|
|
|
+const getTheLogBusinessData = async (excelId, recordDate) => {
|
|
|
+ const {primaryKeyId} = menuItem.value
|
|
|
+ const { data } = await queryApi.getTheLogBusinessData({
|
|
|
+ pkeyId: excelId,
|
|
|
+ nodePrimaryKeyId: primaryKeyId,
|
|
|
+ recordTime: recordDate,
|
|
|
+ theLogId: ""
|
|
|
+ }, false)
|
|
|
+ formLogDataList.value = getArrValue(data)
|
|
|
+ getBussDataInfo()
|
|
|
+}
|
|
|
+
|
|
|
//获取表单初始数据
|
|
|
+const formLogIndex = ref(0)
|
|
|
const tableFormData = ref({})
|
|
|
-const getBussDataInfo = async (excelId) => {
|
|
|
- const { data } = await queryApi.getBussDataInfo({
|
|
|
- pkeyId: excelId
|
|
|
- }, false)
|
|
|
- const info = getObjValue(data)
|
|
|
+const getBussDataInfo = (index = 0) => {
|
|
|
+ const formLog = formLogDataList.value
|
|
|
+ const info = getObjValue(formLog[index])
|
|
|
+ formLogIndex.value = index
|
|
|
if (getObjNullValue(info)) {
|
|
|
const pickerKey = info['pickerKey'] || ''
|
|
|
- const pickerKeys = pickerKey.split(',')
|
|
|
- for (let i = 0; i < pickerKeys.length; i++) {
|
|
|
- const val = info[pickerKeys[i]] || ''
|
|
|
- if (val) {
|
|
|
- const data = val.replace(/'/g,'"');
|
|
|
- info[pickerKeys[i]] = JSON.parse(data)
|
|
|
- } else {
|
|
|
- info[pickerKeys[i]] = []
|
|
|
+ if (pickerKey) {
|
|
|
+ const pickerKeys = pickerKey.split(',')
|
|
|
+ for (let i = 0; i < pickerKeys.length; i++) {
|
|
|
+ const val = info[pickerKeys[i]] || ''
|
|
|
+ if (val) {
|
|
|
+ const data = val.replace(/'/g,'"');
|
|
|
+ info[pickerKeys[i]] = JSON.parse(data)
|
|
|
+ } else {
|
|
|
+ info[pickerKeys[i]] = []
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//有数据,关联数据
|
|
|
tableFormData.value = info
|
|
|
+ console.log(tableFormApp.value)
|
|
|
+ //tableFormApp.value.formData = info
|
|
|
} else {
|
|
|
tableFormData.value = {}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取模板标签数据
|
|
|
+const tableFormApp = ref(null)
|
|
|
const getExcelHtml = async (excelId) => {
|
|
|
//获取数据
|
|
|
const { error, code, data } = await queryApi.getExcelHtml({
|
|
@@ -204,7 +235,7 @@ const getExcelHtml = async (excelId) => {
|
|
|
isTableForm.value = true
|
|
|
//渲染表单
|
|
|
await nextTick(() => {
|
|
|
- HTableForm({
|
|
|
+ tableFormApp.value = HTableForm({
|
|
|
template: resData,
|
|
|
tableForm: tableFormData.value,
|
|
|
appId: `#table-form-${excelId}`
|
|
@@ -312,14 +343,14 @@ const saveExcelBussData = async () => {
|
|
|
tableFormSaveLoading.value = true
|
|
|
const { error, code } = await queryApi.saveExcelBussData({
|
|
|
...tableFormData.value,
|
|
|
- classify: 1,
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
pkeyId: excelIdVal.value,
|
|
|
+ recordTime: recordTime.value,
|
|
|
linkTabIds: linkTabIds,
|
|
|
isTheLog: "1",
|
|
|
theLogId: "",
|
|
|
- recordTime: recordTime.value
|
|
|
+ classify: 1,
|
|
|
},false)
|
|
|
tableFormSaveLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
@@ -364,8 +395,12 @@ const previewBussPdf = () => {
|
|
|
//预览PDF
|
|
|
const getBussPdfInfo = async () => {
|
|
|
previewLoading.value = true
|
|
|
+ const {primaryKeyId} = menuItem.value
|
|
|
const { error, code, data } = await queryApi.getBussPdfInfo({
|
|
|
- pkeyId: excelIdVal.value
|
|
|
+ pkeyId: excelIdVal.value,
|
|
|
+ nodePrimaryKeyId: primaryKeyId,
|
|
|
+ recordTime: recordTime.value,
|
|
|
+ theLogId: ""
|
|
|
}, false)
|
|
|
//处理数据
|
|
|
previewLoading.value = false
|
|
@@ -377,6 +412,63 @@ const getBussPdfInfo = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//获取当前日志资料关联的工序节点信息
|
|
|
+const queryCurrentLogSelectProcessList = async (dateVal) => {
|
|
|
+ const {primaryKeyId} = menuItem.value
|
|
|
+ const { data } = await queryApi.queryCurrentLogSelectProcessList({
|
|
|
+ nodePrimaryKeyId: primaryKeyId,
|
|
|
+ recordTime: dateVal,
|
|
|
+ theLogId: ""
|
|
|
+ }, false)
|
|
|
+ //处理数据
|
|
|
+ let dataKeys = getArrValue(data), NodesArr = []
|
|
|
+ for (let i = 0; i < dataKeys.length; i++) {
|
|
|
+ NodesArr.push({
|
|
|
+ primaryKeyId: dataKeys[i]?.primaryKeyId,
|
|
|
+ pathName: dataKeys[i]?.path
|
|
|
+ })
|
|
|
+ }
|
|
|
+ processDataList.value = NodesArr
|
|
|
+}
|
|
|
+
|
|
|
+//新增表格
|
|
|
+const addTableFormClick = () => {
|
|
|
+ formLogDataList.value.push({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ recordTime: recordTime.value,
|
|
|
+ pkeyId: excelIdVal.value,
|
|
|
+ linkTabIds: [],
|
|
|
+ isTheLog: "1",
|
|
|
+ theLogId: "",
|
|
|
+ classify: 1
|
|
|
+ })
|
|
|
+ const index = formLogDataList.value.length - 1
|
|
|
+ getBussDataInfo(index)
|
|
|
+}
|
|
|
+
|
|
|
+//复制表格内容
|
|
|
+const copyTableFormClick = () => {
|
|
|
+ const formLog = formLogDataList.value
|
|
|
+ const logIndex = formLogIndex.value
|
|
|
+ formLogDataList.value.push({
|
|
|
+ ...formLog[logIndex],
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ recordTime: recordTime.value,
|
|
|
+ pkeyId: excelIdVal.value,
|
|
|
+ isTheLog: "1",
|
|
|
+ theLogId: "",
|
|
|
+ classify: 1
|
|
|
+ })
|
|
|
+ const index = formLogDataList.value.length - 1
|
|
|
+ getBussDataInfo(index)
|
|
|
+}
|
|
|
+
|
|
|
+//复制任意时间
|
|
|
+const copyTheLogBusinessData = () => {
|
|
|
+ //copyTheLogBusinessData
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -401,6 +493,14 @@ const getBussPdfInfo = async () => {
|
|
|
background: #f1f5f8;
|
|
|
border-radius: 10px;
|
|
|
box-shadow: -2px 0px 10px 0px rgba(32,37,50,0.03), 0px 10px 21px 20px rgba(32,37,50,0.03);
|
|
|
+ .hc-fixed-page {
|
|
|
+ position: absolute;
|
|
|
+ top: 4px;
|
|
|
+ right: 4px;
|
|
|
+ bottom: 4px;
|
|
|
+ z-index: 99;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
}
|
|
|
.hc-right-pian-box {
|
|
|
width: 360px;
|
|
@@ -467,4 +567,10 @@ const getBussPdfInfo = async () => {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
}
|
|
|
+.hc-table-form-content .hc-content-box .hc-table-forem-box .hc-fixed-page {
|
|
|
+ .el-button {
|
|
|
+ display: block;
|
|
|
+ margin: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|