Browse Source

其它出库 导入execl sxm 2021-10-28

master
[li_she] 4 years ago
parent
commit
5f1d52d960
  1. 22
      src/views/modules/common/excelUpload.vue
  2. 487
      src/views/modules/finishedProductWarehouse/otherOut.vue
  3. 2
      src/views/modules/job/schedule.vue

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

@ -20,38 +20,34 @@
url: '',
num: 0,
successNum: 0,
fileList: []
fileList: [],
rollList: {}
}
},
methods: {
init (id) {
this.url = this.$http.adornUrl(`/excel/file/upload?token=${this.$cookie.get('token')}&folder=`+this.folder)
console.log(this.url)
this.url = this.$http.adornUrl(`/file/excel/upload?token=${this.$cookie.get('token')}`)
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
// }
if (file.type !== "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" && file.type !== "application/vnd.ms-excel" ) {
this.$message.error('只支持xls、xlsx、格式的文件!')
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.rollList = response
this.childClick()
} else {
this.$message.error(response.msg)
}
},
childClick () {
// childByValueon
this.$emit('childByValue', this.fileList)
this.$emit('excelUploadChild', this.rollList)
}
},
created() {

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

@ -2,29 +2,12 @@
<div class="mod-config">
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg" ></icon-svg>
<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 :inline="true">
<el-form-item>
<el-button @click="getDataList()" type="primary">{{ buttons.search }}</el-button>
<excelUpload v-on:excelUploadChild="excelUploadChild"></excelUpload>
</el-form-item>
</el-form>
<el-table
@ -44,7 +27,7 @@
: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.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
@ -52,281 +35,239 @@
</el-table>
<!-- 设置列 -->
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<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'
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() {
},
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
methods: {
excelUploadChild(childValue) {
// childValue
console.log(childValue)
if (childValue.list.length>0){
this.dataList = childValue.list
this.$message.success("批量出库成功")
}else {
this.$message.warning("批量出库失败")
}
},
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
//
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.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)
this.favorite = false
}
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})=>{
})
},
// 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 = true
this.favorite = false
})
}
},
// 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
} else {
//
saveUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = true
})
},
//
userSetting() {
this.visible = true;
let queryTable = {
userId: this.userId,
functionId: this.functionId,
tableId: this.tableId,
languageCode: this.languageCode
}
},
// 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
}
this.$nextTick(() => {
this.$refs.column.init(queryTable);
});
},
//
getTableUserColumn() {
let queryTableUser = {
userId: this.userId,
functionId: this.functionId,
tableId: this.tableId,
languageCode: this.languageCode,
status: true,
})
},
//
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()
}
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
})
},
//
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)
}
getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
this.showDefault = false
this.columnList = data.rows
} else {
this.showDefault = true
}
})
},
})
this.getFunctionButtonList();
this.getColumnList()
},
created() {
this.getTableUserColumn()
this.getSysLanguageParamList()
this.getFunctionButtonList()
this.favoriteIsOk()
}
// 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{
.sl-svg {
overflow: hidden;
float: right;
}

2
src/views/modules/job/schedule.vue

@ -223,7 +223,7 @@
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '恢复' : '批量恢复'}]操作?`, '提示', {
this.$confirm(`确定进行[${id ? '恢复' : '批量恢复'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

Loading…
Cancel
Save