5 changed files with 556 additions and 3 deletions
-
13src/api/finishedProductWarehouse/soBoxes.js
-
2src/views/common/home.vue
-
1src/views/modules/common/upload.vue
-
541src/views/modules/finishedProductWarehouse/boxingPrint.vue
-
2src/views/modules/sys/menu.vue
@ -0,0 +1,13 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
// 获取箱数据
|
||||
|
export const getSoBoxingList = data => createAPI('/soBoxing/getSoBoxingList','post',data) |
||||
|
|
||||
|
// 获取打印模板数据
|
||||
|
export const getReportFileListByCustomerId = data => createAPI('/packing/getReportFileListByCustomerId','post',data) |
||||
|
|
||||
|
// 获取物料的对应的客户
|
||||
|
export const getCustomerId = data => createAPI('/packing/getCustomerId','post',data) |
||||
|
|
||||
|
// 外箱打印
|
||||
|
export const printPacking = data => createAPI('/packing/printPacking','post',data) |
||||
@ -0,0 +1,541 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<div> |
||||
|
<span @click="favoriteFunction()"> |
||||
|
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg> |
||||
|
</span> |
||||
|
|
||||
|
<el-button @click="searchList()" type="primary">{{ buttons.search }}</el-button> |
||||
|
<el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button> |
||||
|
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }} |
||||
|
</el-button> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<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 |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="150" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<a type="text" size="small" @click="openPrintDialog(scope.row)" herf="#">补打标签</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<!-- 设置列 --> |
||||
|
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column> |
||||
|
|
||||
|
|
||||
|
<el-dialog |
||||
|
:title="msgData.printDialog" |
||||
|
:visible.sync="printVisible" |
||||
|
width="30%" |
||||
|
center> |
||||
|
<el-select :placeholder="msgData.printTemplateMsg" v-model="reportFileVo"> |
||||
|
<el-option v-for="(item,index) in printTemplates" :key="index" :label="item.reportFileVo" :value="item"></el-option> |
||||
|
</el-select> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="printVisible = false">取 消</el-button> |
||||
|
<el-button type="primary" @click="printBox()">打印</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import {getSoBoxingList,getReportFileListByCustomerId,getCustomerId,printPacking} from '@/api/finishedProductWarehouse/soBoxes.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 { |
||||
|
printVisible: false, |
||||
|
searchVisible: false, |
||||
|
searchShow: false, |
||||
|
// table高度 |
||||
|
height: 450, |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
addLanguage: false, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
languageCode: this.$i18n.locale, |
||||
|
visible: false, |
||||
|
showDefault: false, |
||||
|
queryData: { |
||||
|
day: '', |
||||
|
rollno: '', |
||||
|
partno: '' |
||||
|
}, |
||||
|
reportFileVo:{ |
||||
|
reportFamily: '', |
||||
|
reportId: '', |
||||
|
isCustomer: '' |
||||
|
}, |
||||
|
boxNumber: 0, |
||||
|
// 打印模板列表 |
||||
|
printTemplates: [], |
||||
|
// 语言词典集合 |
||||
|
sysLanguageParams: [], |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "id", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "主键", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintId' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "site", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "工厂编号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintSite' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "boxNo", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "箱编号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintBoxNo' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "orderNo", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "订单编号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintOrderNo' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "batchCode", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "批号", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintBatchCode' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "itemCode", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "物料编码", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintItemCode' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "status", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "状态", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintStatus' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "status2", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "状态2", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintStatus2' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "rollsQty", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "卷数量", |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintRollsQty' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "boxType", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "箱类型", |
||||
|
columnHidden: true, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintBoxType' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "createdDate", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "创建时间", |
||||
|
columnHidden: true, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintCreatedDate' |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 1001, |
||||
|
tableId: "1001BoxingPrint", |
||||
|
tableName: "so_receive_boxes", |
||||
|
columnProp: "createdBy", |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: "创建人", |
||||
|
columnHidden: true, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false, |
||||
|
serialNumber: '1001BoxingPrintCreatedBy' |
||||
|
} |
||||
|
], |
||||
|
dataList: [], |
||||
|
buttons: { |
||||
|
add: '添加', |
||||
|
edit: '编辑', |
||||
|
delete: '删除', |
||||
|
deleteList: '批量删除', |
||||
|
cz: '操作', |
||||
|
search: '搜索', |
||||
|
download: '导出', |
||||
|
settingTable: '设置列表', |
||||
|
defaultTable: '设置默认配置' |
||||
|
}, |
||||
|
msgData: { |
||||
|
printDialog: "打印模板选择", |
||||
|
printTemplateMsg: "请选择模板", |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
dataListSelections: [], |
||||
|
addOrUpdateVisible: false |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
column, |
||||
|
search |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 165; |
||||
|
}) |
||||
|
}, |
||||
|
activated() { |
||||
|
this.searchList() |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 打开打印模态框 |
||||
|
openPrintDialog(val){ |
||||
|
this.boxNumber =val.rollsQty |
||||
|
this.printVisible = true |
||||
|
this.getReportFileListByCustomerId(val.itemCode) |
||||
|
}, |
||||
|
// 打印 |
||||
|
printBox(){ |
||||
|
this.printVisible = false |
||||
|
let reportFileVo = { |
||||
|
reportFamily: this.reportFileVo.reportFamily, |
||||
|
reportId: this.reportFileVo.reportId, |
||||
|
isCustomer: this.reportFileVo.isCustomer, |
||||
|
pickingNumber: this.boxNumber |
||||
|
} |
||||
|
printPacking(reportFileVo).then(({data})=>{ |
||||
|
if (data.code == 0){ |
||||
|
this.$message.success(data.msg) |
||||
|
} |
||||
|
if (data.code == 500){ |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
|
||||
|
}).error(({data})=>{ |
||||
|
this.$message.error(data.msg) |
||||
|
}) |
||||
|
}, |
||||
|
// 获取打印模板数据 |
||||
|
getReportFileListByCustomerId(partNo){ |
||||
|
let vo = { |
||||
|
partNo: partNo |
||||
|
} |
||||
|
getCustomerId(vo).then((data)=>{ |
||||
|
let reportFileVo = { |
||||
|
customerId: data. customerId, |
||||
|
reportFamily: '外箱标签' |
||||
|
} |
||||
|
getReportFileListByCustomerId(reportFileVo).then(({data}) =>{ |
||||
|
this.printTemplates = data.reportFileVos |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
// 获取数据 |
||||
|
searchList() { |
||||
|
let soBoxing = {} |
||||
|
getSoBoxingList(soBoxing).then(({data}) => { |
||||
|
this.dataList = data.data |
||||
|
}) |
||||
|
}, |
||||
|
// 校验用户是否收藏 |
||||
|
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> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue