|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div v-loading="loading" class="hc-uni-app-table-form" :class="[editType]">
|
|
|
+ <div class="hc-uni-app-table-form" :class="[editType]">
|
|
|
<hc-table-form ref="tableFormRef" :form="tableFormInfo" :html="excelHtml" :scroll="false" :pkey="appItem.excelId" @render="tableFormRender" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -24,7 +24,6 @@ const useAppState = useAppStore()
|
|
|
const appItem = ref(props.option)
|
|
|
const tableFormRef = ref(null)
|
|
|
const editType = ref('form')
|
|
|
-const loading = ref(false)
|
|
|
|
|
|
//深度监听
|
|
|
watch(() => [
|
|
@@ -75,12 +74,9 @@ const setMessage = ({ data, type }) => {
|
|
|
|
|
|
const getDataApi = async () => {
|
|
|
const { excelId } = appItem.value
|
|
|
- console.log('appItem', appItem.value)
|
|
|
if (excelId) {
|
|
|
- loading.value = true
|
|
|
await getTableFormInfo()
|
|
|
await getExcelHtml()
|
|
|
- loading.value = false
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -165,11 +161,11 @@ const getExcelHtml = async () => {
|
|
|
} else {
|
|
|
excelHtml.value = ''
|
|
|
isTableForm.value = false
|
|
|
- window?.$message?.warning('暂无表单')
|
|
|
+ postMsg('暂无表单', 'error')
|
|
|
}
|
|
|
} else {
|
|
|
isTableForm.value = false
|
|
|
- window?.$message?.error(`excelId: ${excelId || '-1 或 空'}`)
|
|
|
+ postMsg('参数异常', 'error')
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -190,7 +186,7 @@ const addTableFormClick = () => {
|
|
|
const index = formLogDataList.value.length - 1
|
|
|
setFormLength()
|
|
|
getBussDataInfo(index)
|
|
|
- window?.$message?.success('新增成功')
|
|
|
+ postMsg('新增成功', 'success')
|
|
|
}
|
|
|
|
|
|
//删除当前页
|
|
@@ -201,7 +197,7 @@ const delTableFormClick = () => {
|
|
|
formLogIndex.value = logIndex
|
|
|
setFormLength()
|
|
|
getBussDataInfo(logIndex)
|
|
|
- window?.$message?.success('删除成功')
|
|
|
+ postMsg('删除成功', 'success')
|
|
|
}
|
|
|
|
|
|
//复制当前表格及内容
|
|
@@ -216,7 +212,7 @@ const copyTableFormClick = () => {
|
|
|
})
|
|
|
setFormLength()
|
|
|
getBussDataInfo(formLogDataList.value.length - 1)
|
|
|
- window?.$message?.success('复制成功')
|
|
|
+ postMsg('复制成功', 'success')
|
|
|
}
|
|
|
|
|
|
//更新表单数量
|
|
@@ -283,22 +279,22 @@ const toSaveClick = async () => {
|
|
|
return
|
|
|
}
|
|
|
//发起请求
|
|
|
- const { error, code, msg } = await queryApi.saveExcelBussData({
|
|
|
+ const { error, code } = await queryApi.saveExcelBussData({
|
|
|
dataInfo: { orderList: formLog },
|
|
|
}, false)
|
|
|
if (!error && code === 200) {
|
|
|
- window?.$message?.success('保存成功')
|
|
|
postMessage({
|
|
|
type: 'saveRes',
|
|
|
data: true,
|
|
|
})
|
|
|
+ postMsg('保存成功', 'success')
|
|
|
getBussPdfInfo().then()
|
|
|
} else {
|
|
|
- window?.$message?.error(msg)
|
|
|
postMessage({
|
|
|
type: 'saveRes',
|
|
|
data: false,
|
|
|
})
|
|
|
+ postMsg('保存失败', 'error')
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -313,7 +309,7 @@ const isLinkTabIds = async (data) => {
|
|
|
if (isLink) {
|
|
|
return true
|
|
|
} else {
|
|
|
- window?.$message?.warning('请先关联工序')
|
|
|
+ postMsg('请先关联工序', 'error')
|
|
|
return false
|
|
|
}
|
|
|
} else {
|
|
@@ -329,6 +325,18 @@ const postMessage = ({ type, data = {} }) => {
|
|
|
data: data,
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+//弹出提示
|
|
|
+const postMsg = (title, icon) => {
|
|
|
+ window?.postMessage({
|
|
|
+ type: 'msg',
|
|
|
+ source: 'web',
|
|
|
+ data: {
|
|
|
+ title: title,
|
|
|
+ icon: icon,
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|