Commit 935dd10c authored by tanghao's avatar tanghao

123

parent 57a1d15f
......@@ -358,6 +358,7 @@ export function filterVarData(data: any) {
titles
.add('底图名称')
.add('销售单号+行项次')
.add('工单号')
.add('参考数')
.add('品牌名称')
.add('客户名称')
......@@ -368,6 +369,7 @@ export function filterVarData(data: any) {
const rw: Recordable = {}
Reflect.set(rw, '底图名称', row['imageName'])
Reflect.set(rw, '销售单号+行项次', row['orderCodeNo'])
Reflect.set(rw, '工单号', row['workorderCode'])
Reflect.set(rw, '参考数', row['orderNum'])
Reflect.set(rw, '品牌名称', row['brandName'])
Reflect.set(rw, '客户名称', row['customerName'])
......
......@@ -146,7 +146,7 @@
</template>
</vxe-modal>
<vxe-modal v-model="connectVisible" width="700" title="关联信息配置" show-footer>
<vxe-modal v-model="connectVisible" width="1000" title="关联信息配置" show-footer>
<p>关联区域信息:{{ currentConnectInfo.excelAreaNicname }}</p>
<p>被关联信息:{{ cachCurrentBeConnectInfo.excelAreaNicname }}</p>
......@@ -160,7 +160,32 @@
>
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column title="关联title" field="title"></vxe-column>
<vxe-column title="被关联title" field="betitle">
<vxe-column title="关联脚本" width = "300px">
<template #default="{ row }">
<el-select
size="small"
style="width: 100%;"
v-model="row.scriptName"
@change="(e) => scriptChange(row, e)"
clearable
>
<el-option
v-for="item in scriptList"
:key="item.srciptName"
:value="item.srciptName"
:label="item.srciptName"
></el-option>
</el-select>
<el-input
type="textarea"
style="width: 100%;margin-top: 2px;"
rows="5"
v-model="row.script"
></el-input>
</template>
</vxe-column>
<vxe-column title="被关联title" field="script">
<template #default="{ row }">
<el-select v-model="row.betitle" size="small" @change="(v) => changeBeConnect(v, row)">
<template v-for="item in beConnectSelectOptions" :key="item.title">
......@@ -169,6 +194,32 @@
</el-select>
</template>
</vxe-column>
<vxe-column title="被关联脚本" width = "300px">
<template #default="{ row }">
<el-select
size="small"
style="width: 100%;"
v-model="row.bescriptName"
@change="(e) => scriptBeChange(row, e)"
clearable
>
<el-option
v-for="item in scriptList"
:key="item.srciptName"
:value="item.srciptName"
:label="item.srciptName"
></el-option>
</el-select>
<el-input
type="textarea"
style="width: 100%;margin-top: 2px;"
rows="5"
v-model="row.bescript"
></el-input>
</template>
</vxe-column>
</vxe-table>
<template #footer>
<el-button type="primary" @click="confirmConnect">确认</el-button>
......@@ -246,6 +297,13 @@ import {
showsheetbarConfig,
showstatisticBarConfig
} from '@/constants/excelConfig'
import {
apiGetScript
} from '@/api/excel'
import { flatten, cloneDeep } from 'lodash-es'
import { useCommentExcel } from '@/stores/commentExcel'
import { useExcelChangeStore } from '@/stores/excel'
......@@ -288,6 +346,9 @@ const { getFileInfo, isSameFile } = storeToRefs(commentExcelStore)
const connectList = ref<any[]>([])
const chooseVisible = ref(false)
const editVisible = ref(false)
const scriptList = ref<any[]>([])
const currentConnectInfo = reactive<Recordable>({
excelAreaConnectId: '',
excelAreaId: '',
......@@ -321,6 +382,36 @@ const initIsSetSheetMark = (length: number) => {
isSetSheetMark.value = Array.from({ length }).fill(false)
}
const getScriptList = async () => {
const { data } = await apiGetScript()
scriptList.value = data.result
}
const scriptChange = (item, e) => {
if (e) {
console.log(e)
item.script = scriptList.value.find((item1) => item1.srciptName == e)?.scriptContent
} else {
item.script = ''
}
item.show = true
}
const scriptBeChange = (item, e) => {
if (e) {
item.bescript = scriptList.value.find((item1) => item1.srciptName == e)?.scriptContent
} else {
item.bescript = ''
}
item.beshow = true
}
/**
* 存储在本地的区域标记
* locaExcelAreaMarks = {
......@@ -350,6 +441,11 @@ const initExcelAreaMarksKey = (len: number) => {
Reflect.set(locaExcelAreaMarks, index, [])
})
}
const onSaveSuccess = (data: any) => {
locaExcelAreaMarks[data.result['sheetNum']].push(data.result)
}
......@@ -513,7 +609,9 @@ const addConnect = async (list: any) => {
colum: item.colum,
numFlag: item.numFlag,
numTitle: item.numTitle,
only: item.only
only: item.only,
scriptName: item.scriptName,
script: item.script
})
currentConnectInfo.beConnectFiled.push({
......@@ -523,7 +621,9 @@ const addConnect = async (list: any) => {
colum: item.becolum,
numFlag: item.benumFlag,
numTitle: item.benumTitle,
only: item.beonly
only: item.beonly,
scriptName: item.bescriptName,
script: item.bescript
})
})
currentConnectInfo.fileId = getFileInfo.value.orderFileId
......@@ -845,10 +945,14 @@ onMounted(() => {
loadExcel()
getCompareList()
queryConnectList()
getScriptList()
})
onUnmounted(() => {
isFunction((window as any)?.luckysheet?.destroy) && luckysheet.destroy()
})
</script>
<style lang="scss" scoped>
.comment-form {
......
......@@ -28,6 +28,7 @@
</template>
</el-select>
</el-form-item>
<el-form-item label="脚本">
<el-select v-model="formState.scriptName" @change="scriptsChange">
<template v-for="item in scripts">
......
......@@ -146,7 +146,7 @@
</template>
</vxe-modal>
<vxe-modal v-model="connectVisible" width="700" title="关联信息配置" show-footer>
<vxe-modal v-model="connectVisible" width="1000" title="关联信息配置" show-footer>
<p>关联区域信息:{{ currentConnectInfo.excelAreaNicname }}</p>
<p>被关联信息:{{ cachCurrentBeConnectInfo.excelAreaNicname }}</p>
......@@ -160,6 +160,32 @@
>
<vxe-column type="checkbox" width="40"></vxe-column>
<vxe-column title="关联title" field="title"></vxe-column>
<vxe-column title="关联脚本" width = "300px">
<template #default="{ row }">
<el-select
size="small"
style="width: 100%;"
v-model="row.scriptName"
@change="(e) => scriptChange(row, e)"
clearable
>
<el-option
v-for="item in scriptList"
:key="item.srciptName"
:value="item.srciptName"
:label="item.srciptName"
></el-option>
</el-select>
<el-input
type="textarea"
style="width: 100%;margin-top: 2px;"
rows="5"
v-model="row.script"
></el-input>
</template>
</vxe-column>
<vxe-column title="被关联title" field="betitle">
<template #default="{ row }">
<el-select v-model="row.betitle" size="small" @change="(v) => changeBeConnect(v, row)">
......@@ -169,7 +195,33 @@
</el-select>
</template>
</vxe-column>
<vxe-column title="被关联脚本" width = "300px">
<template #default="{ row }">
<el-select
size="small"
style="width: 100%;"
v-model="row.bescriptName"
@change="(e) => scriptBeChange(row, e)"
clearable
>
<el-option
v-for="item in scriptList"
:key="item.srciptName"
:value="item.srciptName"
:label="item.srciptName"
></el-option>
</el-select>
<el-input
type="textarea"
style="width: 100%;margin-top: 2px;"
rows="5"
v-model="row.bescript"
></el-input>
</template>
</vxe-column>
</vxe-table>
<template #footer>
<el-button type="primary" @click="confirmConnect">确认</el-button>
</template>
......@@ -261,6 +313,11 @@ import {
addExcelArea,
batchAddVarExcelArea
} from '@/api/varExcel'
import {
apiGetScript
} from '@/api/excel'
import type { Recordable } from '@/types/global'
import { filterRunData2, getRangetxt, setRangeBackground } from '@/utils/excel'
import type { VxeTableInstance } from 'vxe-table'
......@@ -273,6 +330,7 @@ const showProdCompare = ref(false)
const xTableConnect = ref<VxeTableInstance>()
const beConnectTable = ref<VxeTableInstance>()
const compareData = ref([])
const scriptList = ref<any[]>([])
const compareParams = reactive({
pageSize: 10,
currentPage: 1,
......@@ -339,6 +397,27 @@ const areaTypeLen = computed(() => {
}
)
})
const scriptChange = (item, e) => {
if (e) {
console.log(e)
item.script = scriptList.value.find((item1) => item1.srciptName == e)?.scriptContent
} else {
item.script = ''
}
item.show = true
}
const scriptBeChange = (item, e) => {
if (e) {
item.bescript = scriptList.value.find((item1) => item1.srciptName == e)?.scriptContent
} else {
item.bescript = ''
}
item.beshow = true
}
const deletePic = () => {
luckysheet.deleteImage()
}
......@@ -515,7 +594,9 @@ const addConnect = async (list: any) => {
colum: item.colum,
numFlag: item.numFlag,
numTitle: item.numTitle,
only: item.only
only: item.only,
scriptName: item.scriptName,
script: item.script
})
currentConnectInfo.beConnectFiled.push({
......@@ -525,7 +606,9 @@ const addConnect = async (list: any) => {
colum: item.becolum,
numFlag: item.benumFlag,
numTitle: item.benumTitle,
only: item.beonly
only: item.beonly,
scriptName: item.bescriptName,
script: item.bescript
})
})
currentConnectInfo.fileId = getFileInfo.value.varFileId
......@@ -768,6 +851,11 @@ const toRun = async () => {
}
}
const getScriptList = async () => {
const { data } = await apiGetScript()
scriptList.value = data.result
}
const getCompareList = async () => {
compareParams.customerId = getFileInfo.value.customerId || ''
const { data } = await getExcelProdFileConfPage(compareParams)
......@@ -840,6 +928,7 @@ onMounted(() => {
loadExcel()
getCompareList()
queryConnectList()
getScriptList()
})
onUnmounted(() => {
isFunction((window as any)?.luckysheet?.destroy) && luckysheet.destroy()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment