Browse Source

Merge remote-tracking branch 'origin/master'

master
ruanqi 4 years ago
parent
commit
433523e567
  1. 23
      src/views/common/home.vue
  2. 65
      src/views/modules/common/excelUpload.vue
  3. 333
      src/views/modules/finishedProductWarehouse/otherOut.vue

23
src/views/common/home.vue

@ -1,12 +1,8 @@
<template> <template>
<div class="mod-home"> <div class="mod-home">
<h3>项目介绍</h3>
<h3>旭捷</h3>
<ul> <ul>
<li>xujie-fast-vue基于vueelement-ui构建开发实现 xujie-fast后台管理前端功能提供一套更优的前端解决方案
</li>
<li>前后端分离通过token进行数据交互可独立部署</li>
<li>主题定制通过scss变量统一一站式定制</li>
<li>动态菜单通过菜单管理统一管理访问路由</li>
<li><h3>欢迎:{{userName}}!!!</h3></li>
</ul> </ul>
</div> </div>
</template> </template>
@ -22,6 +18,21 @@
} }
} }
}, },
computed: {
userName: {
get() {
return this.$store.state.user.name
}
},
mainTabs: {
get() {
return this.$store.state.common.mainTabs
},
set(val) {
this.$store.commit('common/updateMainTabs', val)
}
}
},
beforeMount() { beforeMount() {
this.languageRefresh() this.languageRefresh()
} }

65
src/views/modules/common/excelUpload.vue

@ -0,0 +1,65 @@
<template>
<div>
<!-- 弹窗, 上传文件 -->
<el-upload
:action="url"
:before-upload="beforeUploadHandle"
:on-success="successHandle"
multiple
:show-file-list="false"
style="text-align: center;">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</template>
<script>
export default {
data () {
return {
url: '',
num: 0,
successNum: 0,
fileList: []
}
},
methods: {
init (id) {
this.url = this.$http.adornUrl(`/excel/file/upload?token=${this.$cookie.get('token')}&folder=`+this.folder)
console.log(this.url)
this.visible = true
},
//
beforeUploadHandle (file) {
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
// this.$message.error('jpgpnggif')
// return false
// }
this.num++
},
//
successHandle (response, file, fileList) {
this.fileList = fileList.map(item => {
return item.response.ossEntity
})
this.successNum++
if (response && response.code === 0) {
this.childClick()
} else {
this.$message.error(response.msg)
}
},
childClick () {
// childByValueon
this.$emit('childByValue', this.fileList)
}
},
created() {
this.init()
}
}
</script>
<style scoped>
</style>

333
src/views/modules/finishedProductWarehouse/otherOut.vue

@ -0,0 +1,333 @@
<template>
<div class="mod-config">
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg" ></icon-svg>
</span>
</div>
<el-button @click="searchList()" type="primary">{{buttons.search}}</el-button>
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
<el-form v-show="searchShow" :inline="true" :model="queryData" @keyup.enter.native="getDataList()">
<excelUpload></excelUpload>
<el-form-item label="呆滞天数">
<el-input oninput="value=value.replace(/[^\d]/g,'')" v-model="queryData.day" clearable>
</el-input>
</el-form-item>
<el-form-item label="rollno">
<el-input v-model="queryData.rollno" clearable>
</el-input>
</el-form-item>
<el-form-item label="partno">
<el-input v-model="queryData.partno" clearable>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()" type="primary">{{ buttons.search }}</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
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">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<!-- 设置列 -->
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import excelUpload from "../common/excelUpload";
import AddOrUpdate from './crollinfo-add-or-update'
import {getCRollInfoList} from '@/api/crollinfo/crollinfo.js'
import column from "../common/column";
import search from "../common/search";
import {
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
} from "@/api/sysLanguage.js"
import {
saveTableDefaultList,
getTableDefaultListLanguage,
getTableUserListLanguage
} from "@/api/table.js"
import {userFavoriteList,saveUserFavorite,removeUserFavorite} from '@/api/userFavorite.js'
export default {
data () {
return {
searchVisible: false,
searchShow: false,
// table
height:450,
//
favorite: false,
addLanguage: false,
functionId: 1001,
tableId: "1001SluggishMaterial",
languageCode: this.$i18n.locale,
visible: false,
showDefault: false,
queryData: {
day: '',
rollno: '',
partno: ''
},
//
sysLanguageParams: [],
columnList: [],
dataList: [],
buttons: {
add: '添加',
edit: '编辑',
delete: '删除',
deleteList: '批量删除',
cz: '操作',
search: '搜索',
download: '导出',
settingTable: '设置列表',
defaultTable: '设置默认配置'
},
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate,
column,
search,
excelUpload
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 165;
})
},
activated () {
this.getDataList()
},
methods: {
childByValue(childValue) {
// childValue
console.log(childValue)
this.getDataList(childValue)
},
//
searchList() {
if (this.searchShow) {
this.searchShow = false
return
} else {
this.searchShow = true
}
},
//
getDataList() {
this.dataListLoading = true
let query = []
let f = {
queryAttributes: "parttypeFlag",
queryType: "string",
queryValue: "F",
}
query.push(f)
let toexpiredays = {
queryAttributes: "toexpiredays",
queryType: "number",
queryValue: this.queryData.day,
}
query.push(toexpiredays)
if (this.queryData.rollno != '') {
let rollno = {
queryAttributes: "rollno",
queryType: "string",
queryValue: this.queryData.rollno,
}
query.push(rollno)
}
if (this.queryData.partno != '') {
let partno = {
queryAttributes: "partno",
queryType: "string",
queryValue: this.queryData.partno,
}
query.push(partno)
}
getCRollInfoList(query).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.list
}
this.dataListLoading = false
})
// this.searchShow = false
},
//
favoriteIsOk(){
let userFavorite ={
userId:this.$store.state.user.id,
languageCode:this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) => {
let size = data.list.filter(item => item.menuId == this.$route.meta.menuId).length;
if (size>0){
this.favorite = true
}else {
this.favorite = false
}
})
},
// OR
favoriteFunction(){
let userFavorite ={
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite){
//
this.$confirm(`确定取消收藏`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeUserFavorite(userFavorite).then(({data})=>{
this.$message.success(data.msg)
this.favorite = false
})
})
}else {
//
saveUserFavorite(userFavorite).then(({data})=>{
this.$message.success(data.msg)
this.favorite = true
})
}
},
// button
getFunctionButtonList() {
let queryButton = {
functionId: this.functionId,
tableId: this.tableId,
languageCode: this.languageCode,
objectType: 'button'
}
searchFunctionButtonList(queryButton).then(({data}) => {
if (data.data.length>0) {
this.buttons = data.data
}
})
},
//
getSysLanguageParamList() {
let querySysLanguageParam = {
languageCode: this.$i18n.locale
}
searchSysLanguageParam(querySysLanguageParam).then(({data}) => {
this.sysLanguageParams = data.rows
})
},
//
userSetting() {
this.visible = true;
let queryTable = {
userId: this.userId,
functionId: this.functionId,
tableId: this.tableId,
languageCode: this.languageCode
}
this.$nextTick(() => {
this.$refs.column.init(queryTable);
});
},
//
getTableUserColumn() {
let queryTableUser = {
userId: this.userId,
functionId: this.functionId,
tableId: this.tableId,
languageCode: this.languageCode,
status: true,
}
getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
//
saveColumnList() {
this.showDefault = false
saveButtonList(this.buttonList).then(({data}) => {
})
saveTableDefaultList(this.columnList).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.showDefault = false
} else {
this.showDefault = true
this.$message.error(data.msg)
}
})
this.getFunctionButtonList();
this.getColumnList()
},
// tableDefault
getColumnList() {
let queryTable = {
functionId: this.functionId,
tableId: this.tableId,
languageCode: this.languageCode
}
getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
this.showDefault = false
this.columnList = data.rows
} else {
this.showDefault = true
}
})
},
},
created() {
this.getTableUserColumn()
this.getSysLanguageParamList()
this.getFunctionButtonList()
this.favoriteIsOk()
}
}
</script>
<style scoped>
.sl-svg{
overflow: hidden;
float: right;
}
</style>
Loading…
Cancel
Save