Browse Source

基础数据列表 sxm 2021-12-22

master
[li_she] 4 years ago
parent
commit
8a5945a1b7
  1. 7
      src/api/chooselist/chooselist.js
  2. 177
      src/views/modules/common/list.vue
  3. 451
      src/views/modules/sys/language/common.vue

7
src/api/chooselist/chooselist.js

@ -0,0 +1,7 @@
import { createAPI } from "@/utils/httpRequest.js";
export const getChooselist = data => createAPI(`/chooselist/getChooselist/${data.tagNo}`,'get',data)
export const getChooselistData = data => createAPI(`/chooselist/getChooselistData`,'post',data)

177
src/views/modules/common/list.vue

@ -0,0 +1,177 @@
<template>
<el-dialog :title="title" center
:close-on-click-modal="false" :show-close="false" :close-on-press-escape="false"
:visible.sync="visible"
width="685px" v-drag>
<el-form label-position="top"
inline="inline"
size="mini"
label-width="120px">
<el-form-item :label="baseListData.caption1" v-if="baseListData.caption1!='' && baseListData.caption1!=null">
<el-input v-model="param1"></el-input>
</el-form-item>
<el-form-item :label="baseListData.caption2" v-if="baseListData.caption2!='' && baseListData.caption2!=null">
<el-input v-model="param2"></el-input>
</el-form-item>
<el-form-item :label="baseListData.caption4" v-if="baseListData.caption4!='' && baseListData.caption4!=null">
<el-input v-model="param4"></el-input>
</el-form-item>
<el-form-item :label="baseListData.caption3" v-if="baseListData.caption3!='' && baseListData.caption3!=null">
<el-select v-model="param3">
<el-option label="全部" value=""></el-option>
<el-option label="在用" value="Y"></el-option>
<el-option label="不在用" value="N"></el-option>
</el-select>
</el-form-item>
<el-button style="margin-top: 18px" type="primary" @click="getDataList()">查询
</el-button>
</el-form>
<el-table
:height="height"
:data="dataList"
border
@row-dblclick="getRowData"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
{{ scope.row[item.columnProp] }}
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">关闭</el-button>
</span>
</el-dialog>
</template>
<script>
import {
getChooselist,
getChooselistData
} from "@/api/chooselist/chooselist.js"
export default {
data() {
return {
height: 200,
title: '列表',
columnList: [],
queryTable: {},
visible: false,
dataListLoading: true,
fullscreenLoading: false,
param1: '',
param2: '',
param3: '',
param4: '',
dataList: [],
baseListData: {
caption1: '',
caption2: '',
caption3: '',
caption4: '',
description: '',
fieldname1: '',
fieldname2: '',
sqlcode: '',
tagno: '',
}
}
},
methods: {
//
init(tagNo) {
this.visible = true;
// tagNo
getChooselist({"tagNo": tagNo}).then(({data}) => {
this.columnList = []
this.baseListData = data.data
let start = data.data.sqlcode.indexOf("Select")
let end = data.data.sqlcode.indexOf("from")
let length = end - start
let columns = data.data.sqlcode.trim().substring(start + 6, length).trim()
let props = columns.split(",")
props.forEach((item, index) => {
let name = '信息列'
switch (index) {
case 0:
name = this.baseListData.caption1
break;
case 1:
name = this.baseListData.caption2
break;
case 2:
name = this.baseListData.caption3
break;
case 3:
name = this.baseListData.caption4
break;
}
let column = {
"columnProp": item.trim(),
"columnLabel": name,
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"sortLv": index,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
}
this.columnList.push(column)
})
})
this.dataListLoading = false
},
getDataList() {
let sql = this.baseListData.sqlcode
if (this.param1) {
sql += " and " + this.baseListData.fieldname1 + " like '%" + this.param1 + "%'"
}
if (this.param2) {
sql += " and " + this.baseListData.fieldname2 + " like '%" + this.param2 + "%'"
}
if (this.param3) {
sql += " and active like '%" + this.param3 + "%'"
}
if (this.param4) {
sql += " and site=" + this.param4
}
getChooselistData({"sqlcode": sql}).then(({data}) => {
if (data.code == 0) {
this.dataList = data.baseListData;
} else {
this.$message.error(data.msg)
}
})
},
getRowData(row) {
this.$emit('getBaseData',row)
}
}
}
</script>
<style>
</style>

451
src/views/modules/sys/language/common.vue

@ -31,9 +31,7 @@
{{ buttons.download }} {{ buttons.download }}
</download-excel> </download-excel>
<el-button type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">{{ buttons.deleteList}}
</el-button>
<el-button type="primary" @click="getBaseList()">{{ buttons.list }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select filterable v-model="querySysLanguagePack.languageCode" clearable> <el-select filterable v-model="querySysLanguagePack.languageCode" clearable>
@ -84,8 +82,10 @@
<!-- 动态列 --> <!-- 动态列 -->
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column> <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<!-- <list ref="baseList" @getBaseData="getBaseData"></list>-->
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag :title="'设置语言一'+querySysLanguagePack.languageCode" :visible.sync="addLanguage" width="1000px">
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag
:title="'设置语言一'+querySysLanguagePack.languageCode" :visible.sync="addLanguage" width="1000px">
<el-table <el-table
height="450" height="450"
@ -127,12 +127,14 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import column from "../../common/column"; import column from "../../common/column";
import list from '../../common/list'
import { import {
searchSysLanguagePackList, searchSysLanguagePackList,
searchSysLanguageParam, searchSysLanguageParam,
@ -141,22 +143,28 @@ import column from "../../common/column";
searchSysLanguage, searchSysLanguage,
searchLanguageListByLanguageCode, searchLanguageListByLanguageCode,
saveSysLanguageOne, saveSysLanguageOne,
searchPageLanguageData
searchPageLanguageData,
removerLanguage
} from "@/api/sysLanguage.js" } from "@/api/sysLanguage.js"
import getLodop from '@/utils/LodopFuncs.js' import getLodop from '@/utils/LodopFuncs.js'
import { import {
saveTableDefaultList, saveTableDefaultList,
saveTableUser, saveTableUser,
getTableDefaultListLanguage, getTableDefaultListLanguage,
getTableUserListLanguage
getTableUserListLanguage,
removerDefault,
removerUser
} from "@/api/table.js" } from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default { export default {
components: { components: {
column
column,
list
}, },
data() { data() {
return { return {
listShow:false,
// table // table
height: 450, height: 450,
// //
@ -191,11 +199,171 @@ import column from "../../common/column";
userColumnList: [], userColumnList: [],
// //
columnList: [ columnList: [
{
"tableId": "common1001",
"tableName": "common",
"columnProp": "functionId",
"columnLabel": "功能编码",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 0,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1001",
"tableName": "common",
"columnProp": "objectId",
"columnLabel": "序列化编码",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 0,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1001",
"tableName": "common",
"columnProp": "objectType",
"columnLabel": "类型",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 0,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1001",
"tableName": "common",
"columnProp": "languageValue",
"columnLabel": "语言值",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 0,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
}
], ],
// //
columnList1: [ columnList1: [
{
"tableId": "common1002",
"tableName": "commonLanguage",
"columnProp": "functionId",
"columnLabel": "功能编码",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 0,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1002",
"tableName": "commonLanguage",
"columnProp": "languageCode",
"columnLabel": "语言编码",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 0,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1002",
"tableName": "commonLanguage",
"columnProp": "objectId",
"columnLabel": "序列化编码",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 1,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1002",
"tableName": "commonLanguage",
"columnProp": "objectType",
"columnLabel": "类型",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 1,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
},
{
"tableId": "common1002",
"tableName": "commonLanguage",
"columnProp": "languageValue",
"columnLabel": "语言值",
"columnHidden": false,
"columnImage": false,
"columnSortable": false,
"columnWidth": null,
"format": null,
"functionId": "9001",
"sortLv": 2,
"status": true,
"fixed": false,
"serialNumber": null,
"columnType": null,
"align": null
}
], ],
// //
dataList: [], dataList: [],
@ -214,169 +382,89 @@ import column from "../../common/column";
search: '查询', search: '查询',
download: '导出', download: '导出',
settingTable: '设置列表', settingTable: '设置列表',
defaultTable: '设置默认配置'
},
pageLanguageData:{
defaultTable: '设置默认配置',
list: "列表"
}, },
pageLanguageDataList: [
// start
exportData: [],
exportName: "页面功能语言",
exportHeader: ["页面功能语言"],
exportFooter: [],
exportDefaultValue: "这一行这一列没有数据",
// end
buttonList: [
{ {
functionId: "1001",
languageValue: '操作',
objectId: 'operate',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '添加',
objectId: 'add',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '销售单号',
objectId: 'shopOrderNo',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '编辑',
objectId: 'edit',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '箱号',
objectId: 'boxNo',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '删除',
objectId: 'delete',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '物料编号',
objectId: 'partNo',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '批量删除',
objectId: 'deleteList',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '创建时间',
objectId: 'createdDate',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '操作',
objectId: 'cz',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '搜索',
functionId: "9001",
languageValue: '查询',
objectId: 'search', objectId: 'search',
objectType: "page",
tableId: "boxingPrint"
},
{
functionId: "1001",
languageValue: '设置列表',
objectId: 'setting',
objectType: "page",
tableId: "boxingPrint"
},
{
functionId: "1001",
languageValue: '取消',
objectId: 'recall',
objectType: "page",
tableId: "boxingPrint"
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '打印',
objectId: 'print',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '导出',
objectId: 'download',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '请选择模板',
objectId: 'printTemplateMsg',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '设置列表',
objectId: 'settingTable',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '打印模板选择',
objectId: 'printDialog',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '设置默认配置',
objectId: 'defaultTable',
objectType: "button",
tableId: "common1001"
}, },
{ {
functionId: "1001",
languageValue: '标签打印',
objectId: 'labelPrint',
objectType: "page",
tableId: "boxingPrint"
functionId: "9001",
languageValue: '列表',
objectId: 'list',
objectType: "button",
tableId: "common1001"
} }
], ],
// start
exportData: [],
exportName: "页面功能语言",
exportHeader: ["页面功能语言"],
exportFooter: [],
exportDefaultValue: "这一行这一列没有数据",
// end
buttonList: [
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'add',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'edit',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'delete',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'deleteList',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'cz',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'search',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'download',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'settingTable',
// objectType: "button",
// tableId: "common1001"
// },
// {
// functionId: "9001",
// languageValue: '',
// objectId: 'defaultTable',
// objectType: "button",
// tableId: "common1001"
// }
],
languageList: [], languageList: [],
languageColumnList: [], languageColumnList: [],
languageDataList: [], languageDataList: [],
@ -400,8 +488,9 @@ import column from "../../common/column";
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight - 255;
this.height = window.innerHeight - 175;
}) })
}, },
activated() { activated() {
@ -409,6 +498,15 @@ import column from "../../common/column";
this.getLanguageList() this.getLanguageList()
}, },
methods: { methods: {
getBaseData(val){
console.log("父组件"+val)
},
//
getBaseList(){
this.$nextTick(() => {
this.$refs.baseList.init(3)
})
},
// //
printReport() { printReport() {
}, },
@ -495,6 +593,7 @@ import column from "../../common/column";
}, },
// //
getMsgLanguage() { getMsgLanguage() {
this.dataListLoading = true
let queryLang = { let queryLang = {
functionId: 9001, functionId: 9001,
table_id: 'common1001', table_id: 'common1001',
@ -506,6 +605,7 @@ import column from "../../common/column";
} else { } else {
} }
}) })
this.dataListLoading = false
}, },
// button // button
getFunctionButtonList() { getFunctionButtonList() {
@ -551,22 +651,23 @@ import column from "../../common/column";
}, },
// //
saveColumnList() { saveColumnList() {
// button label title
//
if (this.userColumnList) {
// user
removerUser(this.queryTable)
}
//
removerDefault(this.queryTable)
//
removerLanguage(this.queryTable)
// table // table
let sumColumnList = this.columnList.concat(this.columnList1); let sumColumnList = this.columnList.concat(this.columnList1);
saveTableDefaultList(sumColumnList).then(({data}) => { saveTableDefaultList(sumColumnList).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.showDefault = false
} else {
this.$message.error(data.msg)
}
}) })
let pageData =
// button label title
saveButtonList(this.buttonList).then(({data}) => { saveButtonList(this.buttonList).then(({data}) => {
}) })
this.getFunctionButtonList() this.getFunctionButtonList()
this.getFunctionButtonList();
this.getColumnList() this.getColumnList()
}, },
// tableDefault // tableDefault
@ -611,36 +712,6 @@ import column from "../../common/column";
selectionChangeHandle(val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
//
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('//prd/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
// //
fields() { fields() {
let json = "{" let json = "{"
@ -685,6 +756,7 @@ import column from "../../common/column";
.wrapper { .wrapper {
height: calc(100% - 40px); height: calc(100% - 40px);
} }
.sl-input { .sl-input {
background-color: transparent; background-color: transparent;
border: 0 !important; border: 0 !important;
@ -700,6 +772,7 @@ import column from "../../common/column";
outline: none; outline: none;
} }
.sl-svg { .sl-svg {
overflow: hidden; overflow: hidden;
float: right; float: right;

Loading…
Cancel
Save