|
|
@@ -18,8 +18,8 @@
|
|
|
:display-field="displayField"
|
|
|
:display-field-data="displayFieldData"
|
|
|
class="hidden-print"
|
|
|
- :dynamicParams="dynamicParams"
|
|
|
- :formName="template ? template.attrs.form_name : ''"
|
|
|
+ :dynamic-params="dynamicParams"
|
|
|
+ :form-name="template ? template.attrs.form_name : ''"
|
|
|
:class="{ 'ibps-data-template-list__preview': preview }"
|
|
|
@display-field-change="handleDisplayField"
|
|
|
@header-dragend="handleHeaderDragend"
|
|
|
@@ -71,7 +71,22 @@
|
|
|
:label-type="getLinkLabelType(scope.column.field_options)"
|
|
|
:label-key="getLinkLabelKey(scope.column.field_options)"
|
|
|
> -->
|
|
|
- <ibps-link-data v-if="$utils.isNotEmpty(scope.column)" v-model="scope.value" :template-key="scope.column.field_options.linkdata" :multiple="$utils.toBoolean(scope.column.field_options.multiple, true)" :dynamic-params="getLinkDynamicParams(scope.column.field_options, scope.row)" :has-dynamic-params="hasDynamicParams(scope.column.field_options)" :value-key="getLinkValueKey(scope.column.field_options)" :label-type="getLinkLabelType(scope.column.field_options)" :label-key="getLinkLabelKey(scope.column.field_options)" :structure="getLinkStructure(scope.column.field_options)" :config="getLinkConfig(scope.column.field_options)" readonly readonly-text="text" allow-empty-dynamic-params />
|
|
|
+ <ibps-link-data
|
|
|
+ v-if="$utils.isNotEmpty(scope.column)"
|
|
|
+ v-model="scope.value"
|
|
|
+ :template-key="scope.column.field_options.linkdata"
|
|
|
+ :multiple="$utils.toBoolean(scope.column.field_options.multiple, true)"
|
|
|
+ :dynamic-params="getLinkDynamicParams(scope.column.field_options, scope.row)"
|
|
|
+ :has-dynamic-params="hasDynamicParams(scope.column.field_options)"
|
|
|
+ :value-key="getLinkValueKey(scope.column.field_options)"
|
|
|
+ :label-type="getLinkLabelType(scope.column.field_options)"
|
|
|
+ :label-key="getLinkLabelKey(scope.column.field_options)"
|
|
|
+ :structure="getLinkStructure(scope.column.field_options)"
|
|
|
+ :config="getLinkConfig(scope.column.field_options)"
|
|
|
+ readonly
|
|
|
+ readonly-text="text"
|
|
|
+ allow-empty-dynamic-params
|
|
|
+ />
|
|
|
</template>
|
|
|
<!--地址-->
|
|
|
<template v-slot:address="scope">
|
|
|
@@ -82,7 +97,7 @@
|
|
|
</template>
|
|
|
<!--图片-->
|
|
|
<template v-slot:image="scope">
|
|
|
- <ibps-image v-if="$utils.isNotEmpty(scope.column)" height="45" width="45" v-model="scope.value" :multiple="$utils.toBoolean(scope.column.field_options.multiple, true)" :download="scope.column.field_options.download" :store="scope.column.field_options.store" :disabled="true" />
|
|
|
+ <ibps-image v-if="$utils.isNotEmpty(scope.column)" v-model="scope.value" height="45" width="45" :multiple="$utils.toBoolean(scope.column.field_options.multiple, true)" :download="scope.column.field_options.download" :store="scope.column.field_options.store" :disabled="true" />
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:customFormatter="scope">
|
|
|
@@ -90,7 +105,21 @@
|
|
|
</template>
|
|
|
</ibps-crud>
|
|
|
|
|
|
- <data-template-formrender-dialog ref="formrender" :visible="dialogFormVisible" :form-key="formKey" :print-template-id="printTemplateId" :default-data="defaultFormData" :dynamicParams="dynamicParams" :pk-value="pkValue" :toolbars="editToolbars" :readonly="readonly" :template-key="dataTemplate.key" :addDataCont="addDataCont" @callback="search" @close="(visible) => (dialogFormVisible = visible)" />
|
|
|
+ <data-template-formrender-dialog
|
|
|
+ ref="formrender"
|
|
|
+ :visible="dialogFormVisible"
|
|
|
+ :form-key="formKey"
|
|
|
+ :print-template-id="printTemplateId"
|
|
|
+ :default-data="defaultFormData"
|
|
|
+ :dynamic-params="dynamicParams"
|
|
|
+ :pk-value="pkValue"
|
|
|
+ :toolbars="editToolbars"
|
|
|
+ :readonly="readonly"
|
|
|
+ :template-key="dataTemplate.key"
|
|
|
+ :add-data-cont="addDataCont"
|
|
|
+ @callback="search"
|
|
|
+ @close="(visible) => (dialogFormVisible = visible)"
|
|
|
+ />
|
|
|
<!-- 流程定义选择器 -->
|
|
|
<bpm-def-dialog v-model="dialogValue" :visible="dialogVisible" :form-key="formKey" :multiple="false" :is-data-template-use="true" @close="(visible) => (dialogVisible = visible)" @action-event="handleDialogActionEvent" />
|
|
|
<!-- 字段导出 -->
|
|
|
@@ -102,14 +131,14 @@
|
|
|
<!-- 表单打印-->
|
|
|
<form-print-template :id="printTemplateId" :pk="pkValue" :visible="formPrintTemplateDialogVisible" @close="(visible) => (formPrintTemplateDialogVisible = visible)" />
|
|
|
<component :is="dialogTemplate" v-if="dialogTemplate" ref="dialogTemplate" v-bind="dialogTemplateAtts" />
|
|
|
- <bpmn-formrender :visible="npmDialogFormVisible" :def-id="defId" :instance-id="instanceId" :task-id="taskId" :addDataCont="addDataCont" @callback="search" @close="loadFlowFData" />
|
|
|
- <Scan :currentScan="scanName" :scanVisible="scanVisible" :obj="obj" v-if="scanVisible" @scanOff="scanOff" />
|
|
|
+ <bpmn-formrender :visible="npmDialogFormVisible" :def-id="defId" :instance-id="instanceId" :task-id="taskId" :add-data-cont="addDataCont" @callback="search" @close="loadFlowFData" />
|
|
|
+ <Scan v-if="scanVisible" :current-scan="scanName" :scan-visible="scanVisible" :obj="obj" @scanOff="scanOff" />
|
|
|
<print :show="showPrint" :list="printList" :type="printType" />
|
|
|
<labelPrint :show="showPrintYi" :list="printList" :type="printType" />
|
|
|
|
|
|
<import-table :visible="importTableDialogVisible" title="导入" @close="(visible) => (importTableDialogVisible = visible)" @action-event="handleImportTableActionEvent" />
|
|
|
|
|
|
- <xlsxFile :visible="xlsxFileVisible" @xlsxFileClose="xlsxFileClose" v-if="xlsxFileVisible"></xlsxFile>
|
|
|
+ <xlsxFile v-if="xlsxFileVisible" :visible="xlsxFileVisible" @xlsxFileClose="xlsxFileClose" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -150,7 +179,7 @@ import importTable from '@/business/platform/form/formrender/dynamic-form/compon
|
|
|
import JTemplate from '../utils/JTemplate' // 自定义脚本
|
|
|
import Scan from '@/views/system/jbdScan/scan.vue'
|
|
|
|
|
|
-//import BpmnFormrender from '@/vuew/business/platform/bpmn/form/dialog'//新增流程打开页面
|
|
|
+// import BpmnFormrender from '@/vuew/business/platform/bpmn/form/dialog'//新增流程打开页面
|
|
|
import IbpsExport from '@/plugins/export'
|
|
|
import IbpsImport from '@/plugins/import'
|
|
|
import Vue from 'vue'
|
|
|
@@ -183,7 +212,7 @@ export default {
|
|
|
// DataTemplateFormat
|
|
|
},
|
|
|
filters: {
|
|
|
- filterNumber(data, fieldOptions = {}) {
|
|
|
+ filterNumber (data, fieldOptions = {}) {
|
|
|
return filterNumber(data, fieldOptions)
|
|
|
}
|
|
|
},
|
|
|
@@ -206,12 +235,7 @@ export default {
|
|
|
},
|
|
|
xlsxFileVisible: false
|
|
|
},
|
|
|
- destroyed() {
|
|
|
- if (this.dataTemplate.type !== 'dialog') {
|
|
|
- JTemplate.cleanEvents()
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
npmDialogFormVisible: false, // 弹窗
|
|
|
defId: '', // 编辑dialog需要使用
|
|
|
@@ -287,13 +311,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- selectionType() {
|
|
|
+ selectionType () {
|
|
|
return this.multiple ? 'checkbox' : 'radio'
|
|
|
},
|
|
|
- pkKey() {
|
|
|
+ pkKey () {
|
|
|
return this.key || 'id_'
|
|
|
},
|
|
|
- formFieldMap() {
|
|
|
+ formFieldMap () {
|
|
|
if (this.$utils.isEmpty(this.fields)) {
|
|
|
return {}
|
|
|
}
|
|
|
@@ -306,26 +330,26 @@ export default {
|
|
|
}
|
|
|
return map
|
|
|
},
|
|
|
- composeParam() {
|
|
|
+ composeParam () {
|
|
|
return this.composeParams
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
value: {
|
|
|
- handler(val, oldVal) {
|
|
|
+ handler (val, oldVal) {
|
|
|
this.selectionAll = val
|
|
|
},
|
|
|
immediate: true,
|
|
|
deep: true
|
|
|
},
|
|
|
selectionAll: {
|
|
|
- handler(val, oldVal) {
|
|
|
+ handler (val, oldVal) {
|
|
|
this.$emit('selected', val)
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
|
template: {
|
|
|
- handler(val, oldVal) {
|
|
|
+ handler (val, oldVal) {
|
|
|
if (!this.template) {
|
|
|
return
|
|
|
}
|
|
|
@@ -339,14 +363,19 @@ export default {
|
|
|
immediate: true
|
|
|
},
|
|
|
height: {
|
|
|
- handler(val, oldVal) {
|
|
|
+ handler (val, oldVal) {
|
|
|
this.loadHeight()
|
|
|
},
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
+ destroyed () {
|
|
|
+ if (this.dataTemplate.type !== 'dialog') {
|
|
|
+ JTemplate.cleanEvents()
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
- getDatabaseType() {
|
|
|
+ getDatabaseType () {
|
|
|
getDatabaseType()
|
|
|
.then((response) => {
|
|
|
this.databaseType = response.data
|
|
|
@@ -357,7 +386,7 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
- checkPk(pk) {
|
|
|
+ checkPk (pk) {
|
|
|
let pkKey = pk || 'id_'
|
|
|
if (this.databaseType === 'upper') {
|
|
|
pkKey = toUpper(pkKey)
|
|
|
@@ -366,7 +395,7 @@ export default {
|
|
|
}
|
|
|
this.key = pkKey
|
|
|
},
|
|
|
- initUI() {
|
|
|
+ initUI () {
|
|
|
this.initialization = false
|
|
|
if (!this.initialization) {
|
|
|
this.initJTemplate()
|
|
|
@@ -376,7 +405,7 @@ export default {
|
|
|
}, 10)
|
|
|
}
|
|
|
},
|
|
|
- loadHeight() {
|
|
|
+ loadHeight () {
|
|
|
if (this.$utils.isNotEmpty(this.height)) {
|
|
|
this.tableHeight = this.height - 90
|
|
|
} else {
|
|
|
@@ -387,14 +416,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- getParentEl(parentEl) {
|
|
|
+ getParentEl (parentEl) {
|
|
|
if (parentEl.$el && parentEl.$el.nodeName !== '#comment') {
|
|
|
return parentEl.$el
|
|
|
} else {
|
|
|
return this.getParentEl(parentEl.$parent)
|
|
|
}
|
|
|
},
|
|
|
- fixHeight() {
|
|
|
+ fixHeight () {
|
|
|
const parentEl = this.getParentEl(this.$parent)
|
|
|
const parentHeight = parentEl.offsetHeight
|
|
|
// header 高度
|
|
|
@@ -411,7 +440,7 @@ export default {
|
|
|
}
|
|
|
return parentHeight - headerHeight - tabHeight
|
|
|
},
|
|
|
- initData() {
|
|
|
+ initData () {
|
|
|
// if (this.displayField) {
|
|
|
// this.listIdentity = 'ibps-dataTempate-' + this.dataTemplate.key
|
|
|
// this.loadDisplayField()
|
|
|
@@ -423,11 +452,11 @@ export default {
|
|
|
}
|
|
|
this.loadData()
|
|
|
},
|
|
|
- clearSelection() {
|
|
|
+ clearSelection () {
|
|
|
this.$refs['crud'].clearSelection()
|
|
|
this.$emit('selected', this.multiple ? [] : '')
|
|
|
},
|
|
|
- handleSelectionChange(selection) {
|
|
|
+ handleSelectionChange (selection) {
|
|
|
this.selection = selection
|
|
|
setTimeout(() => {
|
|
|
this.changePageCoreRecordData()
|
|
|
@@ -436,7 +465,7 @@ export default {
|
|
|
/**
|
|
|
* 记忆选择核心方法
|
|
|
*/
|
|
|
- changePageCoreRecordData() {
|
|
|
+ changePageCoreRecordData () {
|
|
|
// 如果总记忆中还没有选择的数据,那么就直接取当前页选中的数据,不需要后面一系列计算
|
|
|
if (this.$utils.isEmpty(this.selectionAll)) {
|
|
|
this.selectionAll = this.selection ? JSON.parse(JSON.stringify(this.selection)) : []
|
|
|
@@ -507,7 +536,7 @@ export default {
|
|
|
this.selectionAll = selectionAll[0]
|
|
|
}
|
|
|
},
|
|
|
- setSelectRow() {
|
|
|
+ setSelectRow () {
|
|
|
setTimeout(() => {
|
|
|
this.setRowSelect()
|
|
|
}, 10)
|
|
|
@@ -515,7 +544,7 @@ export default {
|
|
|
/**
|
|
|
* 设置选中的方法
|
|
|
*/
|
|
|
- setRowSelect() {
|
|
|
+ setRowSelect () {
|
|
|
const tableEl = this.$refs['crud']
|
|
|
if (!tableEl) {
|
|
|
return
|
|
|
@@ -544,7 +573,7 @@ export default {
|
|
|
/**
|
|
|
* 获取选择的ID
|
|
|
*/
|
|
|
- getSelectAllIds() {
|
|
|
+ getSelectAllIds () {
|
|
|
const selectAllIds = []
|
|
|
if (this.multiple) {
|
|
|
this.selectionAll.forEach((row) => {
|
|
|
@@ -561,7 +590,7 @@ export default {
|
|
|
* @param {Object} data 需要从中获取值的对象
|
|
|
* @param {Object} defaultValue 默认值
|
|
|
*/
|
|
|
- getPkValue(data, defaultValue = '') {
|
|
|
+ getPkValue (data, defaultValue = '') {
|
|
|
const pkKey = this.pkKey || 'id'
|
|
|
// 创建一个忽略大小写的正则对象
|
|
|
const regx = new RegExp(`^${pkKey}$`, 'gi')
|
|
|
@@ -577,7 +606,7 @@ export default {
|
|
|
/**
|
|
|
* 加载数据
|
|
|
*/
|
|
|
- loadData(outerKey) {
|
|
|
+ loadData (outerKey) {
|
|
|
this.loading = true
|
|
|
if (this.$utils.isEmpty(this.template)) return
|
|
|
queryDataTable(this.getFormatParams(outerKey))
|
|
|
@@ -601,7 +630,7 @@ export default {
|
|
|
/**
|
|
|
* 获取格式化参数
|
|
|
*/
|
|
|
- getFormatParams(outerKey) {
|
|
|
+ getFormatParams (outerKey) {
|
|
|
let formParams = {}
|
|
|
if (this.$refs['searchForm']) {
|
|
|
formParams = this.$refs['searchForm'].getSearcFormData() || {}
|
|
|
@@ -622,7 +651,7 @@ export default {
|
|
|
/**
|
|
|
* 处理分页事件
|
|
|
*/
|
|
|
- handlePaginationChange(page) {
|
|
|
+ handlePaginationChange (page) {
|
|
|
this.changePageCoreRecordData()
|
|
|
ActionUtils.setPagination(this.pagination, page)
|
|
|
this.loadData()
|
|
|
@@ -630,50 +659,50 @@ export default {
|
|
|
/**
|
|
|
* 处理排序
|
|
|
*/
|
|
|
- handleSortChange(sort) {
|
|
|
+ handleSortChange (sort) {
|
|
|
ActionUtils.setSorts(this.sorts, sort)
|
|
|
this.loadData()
|
|
|
},
|
|
|
// 查询数据
|
|
|
- search() {
|
|
|
+ search () {
|
|
|
this.loadData()
|
|
|
this.addDataCont = {}
|
|
|
},
|
|
|
/* 流程页面关闭,刷新当前页面*/
|
|
|
- loadFlowFData() {
|
|
|
+ loadFlowFData () {
|
|
|
this.npmDialogFormVisible = false
|
|
|
this.addDataCont = {}
|
|
|
},
|
|
|
- /*扫码操作*/
|
|
|
- scanHandler(val) {
|
|
|
+ /* 扫码操作*/
|
|
|
+ scanHandler (val) {
|
|
|
this.scanVisible = true
|
|
|
this.scanName = val
|
|
|
},
|
|
|
// /*按钮传参*/
|
|
|
- scanHandlerObj(val, obj) {
|
|
|
+ scanHandlerObj (val, obj) {
|
|
|
this.scanVisible = true
|
|
|
this.scanName = val
|
|
|
this.obj = obj
|
|
|
},
|
|
|
// 一般验收物料标签打印
|
|
|
- labelPrint(data, type) {
|
|
|
+ labelPrint (data, type) {
|
|
|
this.showPrintYi = true
|
|
|
this.printList = data
|
|
|
this.printType = type
|
|
|
},
|
|
|
// 标签打印
|
|
|
- printTag(data, type) {
|
|
|
+ printTag (data, type) {
|
|
|
this.showPrint = true
|
|
|
this.printList = data
|
|
|
this.printType = type
|
|
|
},
|
|
|
/* 返回关闭*/
|
|
|
- scanOff(val) {
|
|
|
+ scanOff (val) {
|
|
|
this.scanVisible = false
|
|
|
this.scanName = ''
|
|
|
this.search()
|
|
|
},
|
|
|
- resetSearchForm() {
|
|
|
+ resetSearchForm () {
|
|
|
if (this.$refs['searchForm']) {
|
|
|
this.$refs['searchForm'].resetSearchForm()
|
|
|
}
|
|
|
@@ -681,7 +710,7 @@ export default {
|
|
|
/**
|
|
|
* 获取显示字段
|
|
|
*/
|
|
|
- loadDisplayField() {
|
|
|
+ loadDisplayField () {
|
|
|
if (!this.preview) {
|
|
|
this.getCustomDataDisplay(this.listIdentity).then((data) => {
|
|
|
this.displayFieldData = data
|
|
|
@@ -690,7 +719,7 @@ export default {
|
|
|
this.displayFieldData = []
|
|
|
}
|
|
|
},
|
|
|
- handleHeaderDragend(newWidth, oldWidth, column, event) {
|
|
|
+ handleHeaderDragend (newWidth, oldWidth, column, event) {
|
|
|
if (this.preview /* || !this.displayField */) {
|
|
|
return
|
|
|
}
|
|
|
@@ -704,7 +733,7 @@ export default {
|
|
|
/**
|
|
|
* 保存显示字段
|
|
|
*/
|
|
|
- handleDisplayField(data, callback, hasMessage) {
|
|
|
+ handleDisplayField (data, callback, hasMessage) {
|
|
|
if (!this.preview) {
|
|
|
this.saveCustomDataDisplay(data, this.listIdentity)
|
|
|
.then((response) => {
|
|
|
@@ -720,7 +749,7 @@ export default {
|
|
|
callback(true)
|
|
|
}
|
|
|
},
|
|
|
- handleAction(command, position, selection, data, index, button) {
|
|
|
+ handleAction (command, position, selection, data, index, button) {
|
|
|
const buttonType = button.button_type || button.key
|
|
|
this.action = buttonType
|
|
|
this.position = position
|
|
|
@@ -851,7 +880,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- exportActions(buttonType, ids, exportColumns) {
|
|
|
+ exportActions (buttonType, ids, exportColumns) {
|
|
|
const { template } = this
|
|
|
if (this.$utils.isNotEmpty(template.export_columns)) {
|
|
|
if (template.export_columns.select_field === 'Y') {
|
|
|
@@ -864,19 +893,19 @@ export default {
|
|
|
this.getResponseData(buttonType, ids)
|
|
|
}
|
|
|
},
|
|
|
- //数据导出
|
|
|
- getIbpsExport(columns, data, title, message, nameKey = 'name') {
|
|
|
+ // 数据导出
|
|
|
+ getIbpsExport (columns, data, title, message, nameKey = 'name') {
|
|
|
IbpsExport.excel({
|
|
|
columns: columns,
|
|
|
data: data,
|
|
|
nameKey: nameKey,
|
|
|
title: title
|
|
|
}).then(() => {
|
|
|
- const msg = message ? message : '导出成功'
|
|
|
+ const msg = message || '导出成功'
|
|
|
ActionUtils.success(msg)
|
|
|
})
|
|
|
},
|
|
|
- getResponseData(buttonType, ids, exportColumns) {
|
|
|
+ getResponseData (buttonType, ids, exportColumns) {
|
|
|
const { template, dataTemplate, fields, pagination, sorts } = this
|
|
|
const params = {}
|
|
|
template.filter_conditions = []
|
|
|
@@ -942,8 +971,8 @@ export default {
|
|
|
params.action = buttonType
|
|
|
|
|
|
params['response_data'] = JSON.stringify(response_data)
|
|
|
- let searcFormData = this.$refs['searchForm'].getSearcFormData() || {}
|
|
|
- for (let key in searcFormData) {
|
|
|
+ const searcFormData = this.$refs['searchForm'].getSearcFormData() || {}
|
|
|
+ for (const key in searcFormData) {
|
|
|
params[key] = searcFormData[key]
|
|
|
}
|
|
|
if (this.$utils.isNotEmpty(exportColumns)) {
|
|
|
@@ -973,7 +1002,7 @@ export default {
|
|
|
})
|
|
|
.catch((err) => console.error(err))
|
|
|
},
|
|
|
- handleExportData(saveData) {
|
|
|
+ handleExportData (saveData) {
|
|
|
exportData(saveData).then((response) => {
|
|
|
if (!response) {
|
|
|
return
|
|
|
@@ -981,11 +1010,11 @@ export default {
|
|
|
ActionUtils.exportFile(response.data, this.dataTemplate.name + '_' + fecha.formatDate('yyyyMMddHHmmss') + '.xls')
|
|
|
})
|
|
|
},
|
|
|
- callbackExtFields(data) {
|
|
|
+ callbackExtFields (data) {
|
|
|
const { action, selecteds } = this
|
|
|
this.getResponseData(action, selecteds, data)
|
|
|
},
|
|
|
- handleStartFlowFromList(id, defKey, formKey) {
|
|
|
+ handleStartFlowFromList (id, defKey, formKey) {
|
|
|
startFlowFromList({
|
|
|
ids: id,
|
|
|
defKey: defKey,
|
|
|
@@ -1003,7 +1032,7 @@ export default {
|
|
|
this.dialogVisible = false
|
|
|
})
|
|
|
},
|
|
|
- handleDialogActionEvent(key, data) {
|
|
|
+ handleDialogActionEvent (key, data) {
|
|
|
if (key === 'clean') {
|
|
|
this.dialogValue = {}
|
|
|
}
|
|
|
@@ -1011,13 +1040,13 @@ export default {
|
|
|
this.handleStartFlowFromList(this.sefStartFlowId, data ? data.defKey : '', this.getFormKey())
|
|
|
}
|
|
|
},
|
|
|
- getFormKey() {
|
|
|
+ getFormKey () {
|
|
|
return this.dataTemplate.attrs ? this.dataTemplate.attrs.form_key || '' : ''
|
|
|
},
|
|
|
- getPrintTemplateId() {
|
|
|
+ getPrintTemplateId () {
|
|
|
return this.dataTemplate.attrs ? this.dataTemplate.attrs.print_id || '' : ''
|
|
|
},
|
|
|
- initParameter() {
|
|
|
+ initParameter () {
|
|
|
this.formKey = this.getFormKey()
|
|
|
// 打印模版
|
|
|
this.printTemplateId = this.getPrintTemplateId()
|
|
|
@@ -1082,7 +1111,7 @@ export default {
|
|
|
searchForm: searchForms.length > 0 ? { forms: searchForms } : null
|
|
|
}
|
|
|
|
|
|
- // 判断地点是否第一层级,如果是显示地点字段
|
|
|
+ // 判断地点是否第一层级
|
|
|
const position = this.$store.getters.userInfo.positions
|
|
|
const first = this.$store.getters.level.first
|
|
|
let showBoolean = false
|
|
|
@@ -1114,7 +1143,7 @@ export default {
|
|
|
this.indexRow = this.template.attrs ? this.template.attrs.indexRow || false : false
|
|
|
this.editButtons = this.template.buttons ? this.template.buttons.edit_buttons || [] : []
|
|
|
},
|
|
|
- setQueryColumns(queryColumns, columns) {
|
|
|
+ setQueryColumns (queryColumns, columns) {
|
|
|
queryColumns.forEach((column) => {
|
|
|
const field = this.convertField(column)
|
|
|
if (field.common === 'N') return
|
|
|
@@ -1125,8 +1154,29 @@ export default {
|
|
|
/**
|
|
|
* 显示字段
|
|
|
*/
|
|
|
- setDisplayColumns(displayColumns, columns) {
|
|
|
+ setDisplayColumns (displayColumns, columns) {
|
|
|
displayColumns.forEach((col) => {
|
|
|
+ //修改宽度
|
|
|
+ switch (col.name) {
|
|
|
+ case 'di_dian_':
|
|
|
+ col.width = '110'
|
|
|
+ break
|
|
|
+ case 'bian_zhi_bu_men_':
|
|
|
+ col.width = '100'
|
|
|
+ col.label = '部门'
|
|
|
+ break
|
|
|
+ case 'bian_zhi_shi_jian':
|
|
|
+ col.width = '120'
|
|
|
+ break
|
|
|
+ case 'bian_zhi_ren_':
|
|
|
+ col.width = '100'
|
|
|
+ break
|
|
|
+ case 'shi_fou_guo_shen_':
|
|
|
+ if (col.label === '状态') {
|
|
|
+ col.width = '75'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
const field = this.convertField(col)
|
|
|
const column = this.buildDisplayColumn(field)
|
|
|
column.sortBy = col.prop
|
|
|
@@ -1148,7 +1198,7 @@ export default {
|
|
|
/**
|
|
|
* 构建按钮
|
|
|
*/
|
|
|
- buildButton(rf, i) {
|
|
|
+ buildButton (rf, i) {
|
|
|
const defaultButton = ButtonsConstants[rf.button_type] || {}
|
|
|
let key = rf.button_type
|
|
|
let mode
|
|
|
@@ -1228,13 +1278,13 @@ export default {
|
|
|
column['data_type'] = dataType
|
|
|
return column
|
|
|
},
|
|
|
- getDatefmt(fieldOptions) {
|
|
|
+ getDatefmt (fieldOptions) {
|
|
|
if (fieldOptions['datefmt_type'] && fieldOptions['datefmt_type'] !== 'custom') {
|
|
|
return FormOptions.t.DATE_FORMATS[fieldOptions['datefmt_type']] || FormOptions.t.DATE_FORMATS['date']
|
|
|
}
|
|
|
return fieldOptions['datefmt'] || FormOptions.t.DATE_FORMATS['date']
|
|
|
},
|
|
|
- buildOptions(options = []) {
|
|
|
+ buildOptions (options = []) {
|
|
|
const rtn = []
|
|
|
options.forEach((option) => {
|
|
|
rtn.push({
|
|
|
@@ -1244,13 +1294,13 @@ export default {
|
|
|
})
|
|
|
return rtn
|
|
|
},
|
|
|
- buildSwitchOptions(fieldOptions) {
|
|
|
+ buildSwitchOptions (fieldOptions) {
|
|
|
return FormUtils.getSwitchOptions(fieldOptions, 'value')
|
|
|
},
|
|
|
/**
|
|
|
* 构建查询条件
|
|
|
*/
|
|
|
- buildSearchForm(field) {
|
|
|
+ buildSearchForm (field) {
|
|
|
let querySuffix = 'SL'
|
|
|
if (field['data_type'] === 'number') {
|
|
|
querySuffix = 'N'
|
|
|
@@ -1360,7 +1410,7 @@ export default {
|
|
|
}
|
|
|
return searchColumn
|
|
|
},
|
|
|
- buildDisplayColumn(field) {
|
|
|
+ buildDisplayColumn (field) {
|
|
|
const displayColumn = {
|
|
|
prop: field.name,
|
|
|
label: field.label,
|
|
|
@@ -1407,47 +1457,47 @@ export default {
|
|
|
}
|
|
|
return false
|
|
|
},
|
|
|
- customFormatter(name, value, rowData, column) {
|
|
|
+ customFormatter (name, value, rowData, column) {
|
|
|
return JTemplate._customFormatter(this, name, value, rowData, column)
|
|
|
},
|
|
|
- hasDynamicParams(fieldOptions) {
|
|
|
+ hasDynamicParams (fieldOptions) {
|
|
|
return FormUtils.hasLinkDynamicParams(fieldOptions)
|
|
|
},
|
|
|
- getLinkDynamicParams(fieldOptions, data) {
|
|
|
+ getLinkDynamicParams (fieldOptions, data) {
|
|
|
return FormUtils.getLinkDynamicParams(fieldOptions, data, this.formFieldMap)
|
|
|
},
|
|
|
- getLinkValueKey(fieldOptions, data) {
|
|
|
+ getLinkValueKey (fieldOptions, data) {
|
|
|
return FormUtils.getLinkValueKey(fieldOptions, data)
|
|
|
},
|
|
|
- getLinkLabelType(fieldOptions, data) {
|
|
|
+ getLinkLabelType (fieldOptions, data) {
|
|
|
return FormUtils.getLinkLabelType(fieldOptions, data)
|
|
|
},
|
|
|
- getLinkLabelKey(fieldOptions, data) {
|
|
|
+ getLinkLabelKey (fieldOptions, data) {
|
|
|
return FormUtils.getLinkLabelKey(fieldOptions, data)
|
|
|
},
|
|
|
- getLinkStructure(fieldOptions, data) {
|
|
|
+ getLinkStructure (fieldOptions, data) {
|
|
|
return FormUtils.getLinkStructure(fieldOptions)
|
|
|
},
|
|
|
- getLinkConfig(fieldOptions, data) {
|
|
|
+ getLinkConfig (fieldOptions, data) {
|
|
|
return FormUtils.getLinkConfig(fieldOptions)
|
|
|
},
|
|
|
- getStreet(value) {
|
|
|
+ getStreet (value) {
|
|
|
if (this.$utils.isNotEmpty(value)) {
|
|
|
const data = this.$utils.parseJSON(value)
|
|
|
return data['street'] || ''
|
|
|
}
|
|
|
return ''
|
|
|
},
|
|
|
- getAddressValue(value, fieldOptions) {
|
|
|
+ getAddressValue (value, fieldOptions) {
|
|
|
return FormUtils.getAddressControlValue(value, fieldOptions)
|
|
|
},
|
|
|
- getAddressTopVal(fieldOptions) {
|
|
|
+ getAddressTopVal (fieldOptions) {
|
|
|
return FormUtils.getAddressTopVal(fieldOptions)
|
|
|
},
|
|
|
/**
|
|
|
* 添加、编辑表单
|
|
|
*/
|
|
|
- handleEdit(pkValue, action = 'edit', position, selection, data) {
|
|
|
+ handleEdit (pkValue, action = 'edit', position, selection, data) {
|
|
|
this.formKey = this.getFormKey()
|
|
|
if (this.$utils.isEmpty(this.formKey)) {
|
|
|
ActionUtils.warning('请绑定表单')
|
|
|
@@ -1478,7 +1528,7 @@ export default {
|
|
|
/**
|
|
|
* 删除表单
|
|
|
*/
|
|
|
- handleRemove(ids, action, position, selection, data) {
|
|
|
+ handleRemove (ids, action, position, selection, data) {
|
|
|
if (this.$utils.isEmpty(this.formKey)) {
|
|
|
ActionUtils.warning('请绑定表单')
|
|
|
return
|
|
|
@@ -1495,34 +1545,34 @@ export default {
|
|
|
})
|
|
|
.catch(() => {})
|
|
|
},
|
|
|
- handlePrint(ids) {
|
|
|
+ handlePrint (ids) {
|
|
|
if (this.$utils.isNotEmpty(this.printTemplateId)) {
|
|
|
this.pkValue = ids
|
|
|
// 打开打印模版页面
|
|
|
this.formPrintTemplateDialogVisible = true
|
|
|
}
|
|
|
},
|
|
|
- handleTemplateDialogActionEvent() {
|
|
|
+ handleTemplateDialogActionEvent () {
|
|
|
// TODO:
|
|
|
},
|
|
|
- getDefaultFormData(selection) {
|
|
|
+ getDefaultFormData (selection) {
|
|
|
const parentIdField = this.fields[this.relatedListFields] || {}
|
|
|
// 如果不是就按命名规律
|
|
|
const pidKey = parentIdField ? parentIdField.field_name || this.relatedListFields : this.relatedListFields
|
|
|
return { [pidKey]: selection }
|
|
|
},
|
|
|
|
|
|
- //自定义导入
|
|
|
- handleImport(data = []) {
|
|
|
+ // 自定义导入
|
|
|
+ handleImport (data = []) {
|
|
|
this.importList = data
|
|
|
this.importVlaue = this.getKeys(this.importList)
|
|
|
this.importTableDialogVisible = true
|
|
|
},
|
|
|
- handleImportTableActionEvent(file, options) {
|
|
|
+ handleImportTableActionEvent (file, options) {
|
|
|
this.loading = false
|
|
|
- let formData = this.setValue(this.importVlaue)
|
|
|
+ const formData = this.setValue(this.importVlaue)
|
|
|
IbpsImport.xlsx(file, options).then(({ header, results }) => {
|
|
|
- let list = []
|
|
|
+ const list = []
|
|
|
results.forEach((item) => {
|
|
|
const data = JSON.parse(JSON.stringify(formData))
|
|
|
for (const key in item) {
|
|
|
@@ -1538,15 +1588,15 @@ export default {
|
|
|
// ActionUtils.success('导入成功')
|
|
|
})
|
|
|
},
|
|
|
- setValue(data) {
|
|
|
- let obj = {}
|
|
|
+ setValue (data) {
|
|
|
+ const obj = {}
|
|
|
Object.values(data).forEach((item) => {
|
|
|
obj[item] = ''
|
|
|
})
|
|
|
return obj
|
|
|
},
|
|
|
- getKeys(data) {
|
|
|
- let obj = {}
|
|
|
+ getKeys (data) {
|
|
|
+ const obj = {}
|
|
|
if (data.length > 0) {
|
|
|
data.forEach((item) => {
|
|
|
obj[item.label] = item.name
|
|
|
@@ -1556,10 +1606,10 @@ export default {
|
|
|
return obj
|
|
|
}
|
|
|
},
|
|
|
- xlsxFileClick() {
|
|
|
+ xlsxFileClick () {
|
|
|
this.xlsxFileVisible = true
|
|
|
},
|
|
|
- xlsxFileClose() {
|
|
|
+ xlsxFileClose () {
|
|
|
this.xlsxFileVisible = false
|
|
|
},
|
|
|
|
|
|
@@ -1567,7 +1617,7 @@ export default {
|
|
|
/**
|
|
|
* 初始化脚本
|
|
|
*/
|
|
|
- initJTemplate() {
|
|
|
+ initJTemplate () {
|
|
|
const id = 'JTemplate'
|
|
|
let script = document.getElementById(id)
|
|
|
if (script) {
|
|
|
@@ -1582,25 +1632,24 @@ export default {
|
|
|
try {
|
|
|
script.appendChild(document.createTextNode(codeScript))
|
|
|
} catch (ex) {
|
|
|
- console.error(ex)
|
|
|
script.text = codeScript
|
|
|
}
|
|
|
document.body.appendChild(script)
|
|
|
}
|
|
|
},
|
|
|
// 处理脚本
|
|
|
- hasScript() {
|
|
|
+ hasScript () {
|
|
|
return true
|
|
|
},
|
|
|
// 加载脚本
|
|
|
- loadScript() {
|
|
|
+ loadScript () {
|
|
|
if (!this.hasScript()) {
|
|
|
return
|
|
|
}
|
|
|
JTemplate._onLoad(this)
|
|
|
},
|
|
|
// 前置脚本
|
|
|
- beforeScript(action, position, selection, data, callback) {
|
|
|
+ beforeScript (action, position, selection, data, callback) {
|
|
|
if (!this.hasScript()) {
|
|
|
const flag = true
|
|
|
callback(flag)
|
|
|
@@ -1609,7 +1658,7 @@ export default {
|
|
|
JTemplate._beforeSubmit(this, action, position, selection, data, callback)
|
|
|
},
|
|
|
// 后置脚本
|
|
|
- afterScript(action, position, selection, data, callback) {
|
|
|
+ afterScript (action, position, selection, data, callback) {
|
|
|
if (!this.hasScript()) {
|
|
|
const flag = true
|
|
|
callback(flag)
|