Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-baoshen-excel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
topsun-baoshen-excel
Commits
cba51fe9
Commit
cba51fe9
authored
Jun 18, 2025
by
tanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
变量确认
parent
35a55178
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
15 deletions
+73
-15
var.ts
src/api/var.ts
+24
-0
FileList.vue
src/views/var/varOrderFile/FileList.vue
+1
-10
Variables.vue
src/views/var/variables/Variables.vue
+48
-5
No files found.
src/api/var.ts
View file @
cba51fe9
...
@@ -155,6 +155,30 @@ export const apiOrderVarGetOrderNewVars = (orderItemId: any) => {
...
@@ -155,6 +155,30 @@ export const apiOrderVarGetOrderNewVars = (orderItemId: any) => {
});
});
};
};
/**
* 根据标量模板文件ID获取转换后变量
* @param orderItemId
* @returns
*/
export
const
confirmVar
=
(
orderItemId
:
any
)
=>
{
return
axios
.
get
(
"/api/orderVar/confirm"
,
{
params
:
{
orderItemId
}
});
};
/**
* 撤销确认的订单
* @param orderItemId
* @returns
*/
export
const
cancelVar
=
(
orderItemId
:
any
)
=>
{
return
axios
.
get
(
"/api/orderVar/cancel"
,
{
params
:
{
orderItemId
}
});
};
/**
/**
* 获取变量下拉数据
* 获取变量下拉数据
* @param orderItemId
* @param orderItemId
...
...
src/views/var/varOrderFile/FileList.vue
View file @
cba51fe9
...
@@ -29,15 +29,6 @@
...
@@ -29,15 +29,6 @@
</
template
>
</
template
>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<!--
<el-form-item label="创建人">
<el-input v-model="formState.createby_dict" placeholder="">
<template #append>
<el-button :icon="MoreFilled" @click="visibleUserModal = true"></el-button>
</template>
</el-input>
</el-form-item> -->
<el-form-item>
<el-form-item>
<el-button
type=
"default"
@
click=
"onReset"
>
重置
</el-button>
<el-button
type=
"default"
@
click=
"onReset"
>
重置
</el-button>
...
@@ -87,7 +78,7 @@
...
@@ -87,7 +78,7 @@
>
>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
field=
"orderFileStatus_dictText"
title=
"
订单
状态"
width=
"120"
></vxe-column>
<vxe-column
field=
"orderFileStatus_dictText"
title=
"
文件
状态"
width=
"120"
></vxe-column>
<vxe-column
field=
"createTime"
title=
"创建时间"
width=
"180"
></vxe-column>
<vxe-column
field=
"createTime"
title=
"创建时间"
width=
"180"
></vxe-column>
...
...
src/views/var/variables/Variables.vue
View file @
cba51fe9
...
@@ -122,18 +122,21 @@
...
@@ -122,18 +122,21 @@
>
{{
item
}}
</el-link>
>
{{
item
}}
</el-link>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
field=
"varStatus_dictText"
title=
"变量状态"
width=
"120"
></vxe-column>
<vxe-column
title=
"解析"
width=
"100"
>
<vxe-column
title=
"解析"
width=
"100"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-button
v-if=
"!!row.varOrderFileId"
type=
"text"
size=
"small"
@
click=
"toRun(row)"
<el-button
v-if=
"!!row.varOrderFileId
&&row.varStatus != 'confirm'
"
type=
"text"
size=
"small"
@
click=
"toRun(row)"
>
执行解析
</el-button
>
执行解析
</el-button
>
>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
<vxe-column
title=
"操作"
width=
"240"
>
<vxe-column
title=
"操作"
width=
"240"
>
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-button
type=
"text"
size=
"small"
@
click=
"handleImportVar(row)"
>
上传变量
</el-button>
<el-button
v-if=
"row.varStatus != 'confirm'"
type=
"text"
size=
"small"
@
click=
"handleImportVar(row)"
>
上传变量
</el-button>
<el-button
v-if=
"row.varStatus == 'converted'"
type=
"text"
size=
"small"
@
click=
"hanldeConfirmVar(row)"
>
确认
</el-button>
<el-button
v-if=
"row.varStatus == 'confirm'"
type=
"text"
size=
"small"
@
click=
"hanldeCancel(row)"
>
撤回
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleShowVarRun(row)"
>
查看解析
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleShowVarRun(row)"
>
查看解析
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"handleCheckOrder(row)"
>
检查
</el-button>
</
template
>
</
template
>
</vxe-column>
</vxe-column>
</vxe-table>
</vxe-table>
...
@@ -204,11 +207,14 @@
...
@@ -204,11 +207,14 @@
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
nextTick
,
onMounted
,
reactive
,
ref
}
from
'vue'
import
{
nextTick
,
onMounted
,
reactive
,
ref
}
from
'vue'
import
{
import
{
apiOrderVarPage
,
apiOrderVarPage
,
apiOrderVarGetVars
,
apiOrderVarGetVars
,
apiOrderVarGetOrderNewVars
,
apiOrderVarGetOrderNewVars
,
confirmVar
,
cancelVar
,
apiOrderVarSaveUpload
,
apiOrderVarSaveUpload
,
apiOrderVarRun
,
apiOrderVarRun
,
getCheckOrder
getCheckOrder
...
@@ -219,7 +225,7 @@ import ChooseOrderItem from './components/ChooseOrderItem.vue'
...
@@ -219,7 +225,7 @@ import ChooseOrderItem from './components/ChooseOrderItem.vue'
import
{
filterVarData
}
from
'@/utils/excel'
import
{
filterVarData
}
from
'@/utils/excel'
import
{
uploadFile
}
from
'@/api/excel'
import
{
uploadFile
}
from
'@/api/excel'
import
{
ElLoading
,
ElMessage
}
from
'element-plus'
import
{
ElLoading
,
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
exportExcel
}
from
'@/utils/export-excel'
import
{
exportExcel
}
from
'@/utils/export-excel'
import
type
{
BookType
}
from
'xlsx'
import
type
{
BookType
}
from
'xlsx'
import
CheckOrder
from
'./components/CheckOrder.vue'
import
CheckOrder
from
'./components/CheckOrder.vue'
...
@@ -261,10 +267,10 @@ const handleShowVarRun = async (row: any) => {
...
@@ -261,10 +267,10 @@ const handleShowVarRun = async (row: any) => {
currentRow
.
value
=
row
currentRow
.
value
=
row
const
{
data
}
=
await
apiOrderVarGetOrderNewVars
(
row
.
orderItemId
)
const
{
data
}
=
await
apiOrderVarGetOrderNewVars
(
row
.
orderItemId
)
if
(
data
?.
code
===
500
)
{
if
(
data
?.
code
===
500
)
{
loading
.
value
=
false
return
ElMessage
.
error
(
data
.
message
||
'操作失败!'
)
return
ElMessage
.
error
(
data
.
message
||
'操作失败!'
)
}
}
const
{
res
,
titles
}
=
filterVarData
(
data
.
result
.
varOrders
||
[])
const
{
res
,
titles
}
=
filterVarData
(
data
.
result
.
varOrders
||
[])
console
.
log
(
titles
)
detailVariable
.
value
.
titles
=
titles
as
any
detailVariable
.
value
.
titles
=
titles
as
any
detailVariable
.
value
.
data
=
res
as
any
detailVariable
.
value
.
data
=
res
as
any
detailVariable
.
value
.
errors
=
data
.
result
?.
errors
||
[]
detailVariable
.
value
.
errors
=
data
.
result
?.
errors
||
[]
...
@@ -275,6 +281,43 @@ const handleShowVarRun = async (row: any) => {
...
@@ -275,6 +281,43 @@ const handleShowVarRun = async (row: any) => {
})
})
}
}
const
hanldeConfirmVar
=
async
(
row
:
any
)
=>
{
await
ElMessageBox
.
confirm
(
'是否确认转换后的变量?'
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
const
{
data
}
=
await
confirmVar
(
row
.
orderItemId
)
if
(
data
.
code
==
200
)
{
ElMessage
.
success
(
data
.
message
||
'操作成功!'
)
}
else
{
ElMessage
.
error
(
data
.
message
||
'操作失败!'
)
}
onQuery
()
}
const
hanldeCancel
=
async
(
row
:
any
)
=>
{
await
ElMessageBox
.
confirm
(
'是否撤回已确认的变量?'
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
const
{
data
}
=
await
cancelVar
(
row
.
orderItemId
)
if
(
data
.
code
==
200
)
{
ElMessage
.
success
(
data
.
message
||
'操作成功!'
)
}
else
{
ElMessage
.
error
(
data
.
message
||
'操作失败!'
)
}
onQuery
()
}
const
importVisible
=
ref
(
false
)
const
importVisible
=
ref
(
false
)
const
importForm
=
ref
({
const
importForm
=
ref
({
customerName
:
''
,
customerName
:
''
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment