Browse Source

聚水潭接口部分数据提交 LR

master
DOUDOU 2 years ago
parent
commit
5bafc53fb7
  1. 10
      src/api/jst/purchase_order_exception.js
  2. 514
      src/views/modules/jst/purchase_order_exception.vue

10
src/api/jst/purchase_order_exception.js

@ -0,0 +1,10 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取全部的异常信息
export const getPurchaseOrderException = data => createAPI('/jst/getPurchaseOrderException', 'post', data)
// 同步采购相关的异常信息
export const reSyncIfsException = data => createAPI('/jst/reSyncIfsException', 'post', data)

514
src/views/modules/jst/purchase_order_exception.vue

@ -0,0 +1,514 @@
<script src="../../../api/jst/purchase_order_exception.js"></script>
<template>
<div class="mod-config">
<el-form v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'采购单号:'">
<el-input v-model="searchData.poId" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'异常分类:'">
<el-select v-model="searchData.histType" style="width: 120px">
<el-option label="全部" value="ALL"></el-option>
<el-option label="采购单" value="purchaseOrder" el-selected></el-option>
<el-option label="采购入库" value="purchaseInStock"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="refreshPageTables()" style="margin-left: 0px" type="primary">查询</el-button>
</el-form-item>
<el-form-item :label="' '">
<download-excel
:fields="fields()"
type="xls"
:name="exportName"
:fetch="createExportData"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:height="height"
:data="tableData"
ref="purchaseTable"
highlight-current-row
@row-click="setCurrentRow"
@current-change="changeCurrentRow"
border
style="width: 100%">
<el-table-column
fixed="left"
header-align="center"
align="center"
width="75"
label=操作>
<template slot-scope="scope">
<a class="customer-a" @click="reSyncIfsException(scope.row)">重新同步</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
header-align="center"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false: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>
</div>
</template>
<script>
import {
getPurchaseOrderException,
reSyncIfsException,
} from '@/api/jst/purchase_order_exception.js'
import Vue from 'vue'
export default {
name: 'purchaseOrder',
data () {
return {
// + start
exportData: [],
userDev: this.$store.state.user.userDev,
exportName: '异常记录表' + this.getStrDate(),
columnList: [
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'poId',
columnLabel: '采购单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 90,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'ioId',
columnLabel: '入库单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 90,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'poDate',
columnLabel: '采购时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'ioDate',
columnLabel: '入库时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'skuId',
columnLabel: '商品编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 90,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'supplierId',
columnLabel: '供应商编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'seller',
columnLabel: '供应商名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 60,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'purchaserName',
columnLabel: '采购员',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 90,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'labels',
columnLabel: '标签',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 80,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'right'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'syncTime',
columnLabel: '同步时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 120,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'exceptionRemark',
columnLabel: '异常信息',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 180,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
{
tableId: 'purchaseOrderHist',
tableName: this.$route.meta.title,
columnProp: 'histType',
columnLabel: '业务分类',
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: 90,
format: null,
functionId: this.$route.meta.menuId,
sortLv: 0,
status: true,
fixed: '',
serialNumber: null,
columnType: null,
align: 'left'
},
],
currentRow:{},
visible: false,
// end
height: 200,
tableData: [],
searchData: {
poId: '',
histType: 'ALL',
},
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
},
methods: {
refreshPageTables () {
getPurchaseOrderException(this.searchData).then(({data}) => {
this.tableData = data.rows;
if(data.total > 0){
//
this.$refs.purchaseTable.setCurrentRow(this.tableData[0]);
}
})
},
//excel
reSyncIfsException(){
reSyncIfsException(this.currentRow).then(({data}) =>{
if(data.code === 200){
this.$message.success('操作成功!');
//
this.refreshPageTables();
}else{
this.$message.error(data.msg)
}
});
},
/*设置工艺的行*/
setCurrentRow(row, column, event) {
this.currentRow = row;
},
//
/*当前值发生变化的时候修改*/
changeCurrentRow(row, oldRow){
//
if(row){
this.currentRow = JSON.parse(JSON.stringify(row));
}
},
// +
fields () {
let json = '{'
this.columnList.forEach((item, index) => {
if (index === this.columnList.length - 1) {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
} else {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
}
})
json += '}'
return eval('(' + json + ')')
},
createExportData () {
// ,,
return this.tableData
},
getStrDate () {
let dd = new Date()
let Y = dd.getFullYear()
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 100
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 100
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
return Y + M + D + H + MM + S
},
userSetting () {
this.visible = true
this.$nextTick(() => {
this.$refs.column.init(this.queryTable)
})
},
/*新增文件的modal*/
addUploadFileModal(){
//
this.$nextTick(() => {
this.$refs.comSalesOrderUploadFile.init();
})
},
/*导出销售单明细的数据*/
exportSalesOrder(){
downSalesOrder('download').then(({data}) => {
//
const blob = new Blob([data], {type: 'application/octet-stream;charset=utf-8'})
//
const fileName = '销售单明细.xlsx';
// a
const linkNode = document.createElement('a')
linkNode.download = fileName // adownload
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob) // Blob URL
console.log(linkNode)
// if(val == 'Y'){
// this.pdfVisible = true
// this.pdfUrl = linkNode.href
// }else {
document.body.appendChild(linkNode)
linkNode.click() //
URL.revokeObjectURL(linkNode.href) // URL
document.body.removeChild(linkNode)
})
/*axios.get('/proxyApi/jst/downSalesOrder?remark=', {
responseType: 'blob',
headers: {
'Content-Type': 'application/json',
'token': Vue.cookie.get('token')
}
}).then(({data}) => {
//
const blob = new Blob([data], {type: "application/octet-stream"})
//
const fileName = "销售明细.xlsx"
console.info(fileName);
// a
const linkNode = document.createElement('a')
linkNode.download = fileName // adownload
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob) // Blob URL
debugger;
document.body.appendChild(linkNode)
linkNode.click() //
URL.revokeObjectURL(linkNode.href) // URL
document.body.removeChild(linkNode)
// }
})*/
/*let url = '/api/ftp/file//downSalesOrder'
let token = Vue.cookie.get('token');
axios.get(url,{
headers: {
'Content-Type': 'application/json',
'token': token
},
responseType: 'blob',//
}).then(function (res) {
if (!res) return
let blob = new Blob([res.data], {type: 'application/vnd.ms-excel;charset=utf8'})
var downloadElement = documentcreateElement('a');
var href = window.URL.createObjectURL(blob); //
downloadElement.href = href;
downloadElement.download = '销售明细导出.xlsx'; //
document.body.appendChild(downloadElement);
downloadElement.click(); //
document.body.removeChild(downloadElement); //
window.URL.revokeobjectURL(href); //blob
}).catch(function (error){
console.log(error)
})*/
/*let url = '/proxyApi/jst/downSalesOrder?remark=';
const xhr = new XMLHttpRequest()
xhr.open('get', url)
xhr.responseType = 'blob'//
xhr.setRequestHeader('token', Vue.cookie.get('token')) // token
xhr.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
const name = '销售明细';
// IE
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(this.response, name)
return
}
const href = window.URL.createObjectURL(this.response)
const link = document.createElement('a')
link.style.display = 'none'
link.href = href
link.setAttribute('download', name)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(href) // blob
}
}
xhr.send();*/
},
},
created() {
this.refreshPageTables();
// this.getLanguageList()
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save