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. 145
      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: '', url: '',
num: 0, num: 0,
successNum: 0, successNum: 0,
fileList: []
fileList: [],
rollList: {}
} }
}, },
methods: { methods: {
init (id) { 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 this.visible = true
}, },
// //
beforeUploadHandle (file) { 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++ this.num++
}, },
// //
successHandle (response, file, fileList) { successHandle (response, file, fileList) {
this.fileList = fileList.map(item => {
return item.response.ossEntity
})
this.successNum++
if (response && response.code === 0) { if (response && response.code === 0) {
this.rollList = response
this.childClick() this.childClick()
} else { } else {
this.$message.error(response.msg) this.$message.error(response.msg)
} }
}, },
childClick () { childClick () {
// childByValueon
this.$emit('childByValue', this.fileList)
this.$emit('excelUploadChild', this.rollList)
} }
}, },
created() { created() {

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

@ -2,29 +2,12 @@
<div class="mod-config"> <div class="mod-config">
<div> <div>
<span @click="favoriteFunction()"> <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> </span>
</div> </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-form-item>
<el-button @click="getDataList()" type="primary">{{ buttons.search }}</el-button>
<excelUpload v-on:excelUploadChild="excelUploadChild"></excelUpload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -44,7 +27,7 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <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]" <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span> style="width: 100px; height: 80px"/></span>
</template> </template>
@ -59,30 +42,30 @@
</template> </template>
<script> <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 {
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, searchSysLanguageParam,
searchFunctionButtonList, searchFunctionButtonList,
saveButtonList, saveButtonList,
} from "@/api/sysLanguage.js"
import {
} from "@/api/sysLanguage.js"
import {
saveTableDefaultList, saveTableDefaultList,
getTableDefaultListLanguage, getTableDefaultListLanguage,
getTableUserListLanguage getTableUserListLanguage
} from "@/api/table.js"
import {userFavoriteList,saveUserFavorite,removeUserFavorite} from '@/api/userFavorite.js'
} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
data () {
export default {
data() {
return { return {
searchVisible: false, searchVisible: false,
searchShow: false, searchShow: false,
// table // table
height:450,
height: 450,
// //
favorite: false, favorite: false,
addLanguage: false, addLanguage: false,
@ -123,104 +106,62 @@
excelUpload excelUpload
}, },
mounted() { mounted() {
this.$nextTick(()=>{
this.$nextTick(() => {
this.height = window.innerHeight - 165; this.height = window.innerHeight - 165;
}) })
}, },
activated () {
this.getDataList()
activated() {
}, },
methods: { methods: {
childByValue(childValue) {
excelUploadChild(childValue) {
// childValue // childValue
console.log(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
if (childValue.list.length>0){
this.dataList = childValue.list
this.$message.success("批量出库成功")
}else {
this.$message.warning("批量出库失败")
} }
this.dataListLoading = false
})
// this.searchShow = false
}, },
// //
favoriteIsOk(){
let userFavorite ={
userId:this.$store.state.user.id,
languageCode:this.$i18n.locale
favoriteIsOk() {
let userFavorite = {
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
} }
userFavoriteList(userFavorite).then(({data}) => { userFavoriteList(userFavorite).then(({data}) => {
let size = data.list.filter(item => item.menuId == this.$route.meta.menuId).length; let size = data.list.filter(item => item.menuId == this.$route.meta.menuId).length;
if (size>0){
if (size > 0) {
this.favorite = true this.favorite = true
}else {
} else {
this.favorite = false this.favorite = false
} }
}) })
}, },
// OR // OR
favoriteFunction(){
let userFavorite ={
favoriteFunction() {
let userFavorite = {
userId: this.$store.state.user.id, userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId, functionId: this.$route.meta.menuId,
} }
if (this.favorite){
if (this.favorite) {
// //
this.$confirm(`确定取消收藏`, '提示', { this.$confirm(`确定取消收藏`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
removeUserFavorite(userFavorite).then(({data})=>{
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg) this.$message.success(data.msg)
this.favorite = false this.favorite = false
}) })
}) })
}else {
} else {
// //
saveUserFavorite(userFavorite).then(({data})=>{
saveUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg) this.$message.success(data.msg)
this.favorite = true this.favorite = true
}) })
@ -236,7 +177,7 @@
objectType: 'button' objectType: 'button'
} }
searchFunctionButtonList(queryButton).then(({data}) => { searchFunctionButtonList(queryButton).then(({data}) => {
if (data.data.length>0) {
if (data.data.length > 0) {
this.buttons = data.data this.buttons = data.data
} }
}) })
@ -323,10 +264,10 @@
this.getFunctionButtonList() this.getFunctionButtonList()
this.favoriteIsOk() this.favoriteIsOk()
} }
}
}
</script> </script>
<style scoped> <style scoped>
.sl-svg{
.sl-svg {
overflow: hidden; overflow: hidden;
float: right; float: right;
} }

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

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

Loading…
Cancel
Save