xunyu.guo
3 years ago
9 changed files with 4600 additions and 0 deletions
@ -0,0 +1,621 @@ |
|||
<!--红旗H平台出库单-明细数据--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="info" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出全部 |
|||
</el-button> --> |
|||
<JobSelectVerson |
|||
:options="JobVersionList" |
|||
style="width: 150px; margin-left: -10px" |
|||
class="search-container" |
|||
@value-change="JobVersionValue" |
|||
></JobSelectVerson> |
|||
<el-button |
|||
class="filter-item" |
|||
type="success" |
|||
icon="el-icon-check" |
|||
size="mini" |
|||
@click="handleCreateBills()" |
|||
>确认出库单(支持批量)</el-button |
|||
> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
@click="handleCancelBills()" |
|||
>取消出库(支持批量) |
|||
</el-button> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照零件号搜索..." |
|||
style="width: 230px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
:header-cell-style="headerRowStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column type="selection" width="44px"></el-table-column> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable="custom" |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; |
|||
|
|||
export default { |
|||
name: "sendUnsettledDiffReport", |
|||
components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson }, |
|||
directives: { permission }, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "hq-h-OutOrder", |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
parentId: "", |
|||
version: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
JobVersionList: [ |
|||
{ value: "0", label: "未处理" }, |
|||
{ value: "1", label: "申请出库" }, |
|||
{ value: "2", label: "确认出库" }, |
|||
{ value: "3", label: "不能出库" }, |
|||
{ value: "4", label: "取消出库" }, |
|||
], |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
billNum: "", |
|||
}, |
|||
listOutPutQuery: { |
|||
version: "", |
|||
guids: "", |
|||
billNum: "", |
|||
}, |
|||
page: 1, |
|||
JobversionValue: "", |
|||
JobversionValueVerson: "", |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 230, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 190; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
watch: { |
|||
customerInfos: { |
|||
handler(newVal) { |
|||
if (newVal == "" || newVal == "undefined") { |
|||
//TODO |
|||
} else { |
|||
newVal.forEach((element) => { |
|||
this.customerInfo.parentId = element.ParentId; |
|||
this.customerInfo.version = element.Version; |
|||
}); |
|||
if (this.customerInfo.parentId != "") { |
|||
this.getList(); |
|||
} |
|||
} |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
|
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 110, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "订货看板编号", |
|||
prop: "kanban", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "交货单号", prop: "wmsBillNum", width: 110 }); |
|||
tempsTabs.push({ label: "Sap编码", prop: "materialCode", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "物料组(车型)", |
|||
prop: "materialGroup", |
|||
width: 220, |
|||
}); |
|||
tempsTabs.push({ label: "发货零件号", prop: "extend1", width: 220 }); |
|||
tempsTabs.push({ label: "收货仓库", prop: "extend2", width: 120 }); |
|||
tempsTabs.push({ label: "结算数量", prop: "qty", width: 100 }); |
|||
|
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
//版本下拉列表选择项 |
|||
JobVersionValue(params) { |
|||
//版本下拉选择 |
|||
this.listQuery.Filters = []; |
|||
var column = "state"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: params.value, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
this.getList(); |
|||
}, |
|||
//取消出库单 |
|||
handleCancelBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message({ |
|||
message: "至少选择一行!", |
|||
type: "warning", |
|||
}); |
|||
return; |
|||
} |
|||
var params = []; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
params.push(id); |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.guids = params; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); |
|||
|
|||
this.$confirm("是否确认取消出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/WMSHQFKanbanoutput/WmsHQFKanbanOutPut-Cancel", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "操作成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
}); |
|||
}, |
|||
//出库单 |
|||
handleCreateBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.listLoading = true; |
|||
this.listOutPutQuery.guids = []; |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log( |
|||
"未选择时全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) |
|||
); |
|||
this.$confirm("是否全部确认出库?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/WMSHQFKanbanoutput/WmsHQFKanbanOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
this.listLoading = false; |
|||
}); |
|||
} else { |
|||
this.listLoading = true; |
|||
var params = []; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
params.push(id); |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.guids = params; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log( |
|||
"部分选择时确认出库条件:" + JSON.stringify(this.listOutPutQuery) |
|||
); |
|||
this.$confirm("是否确认将选中的出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/WMSHQFKanbanoutput/WmsHQFKanbanOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
this.listLoading = false; |
|||
}); |
|||
} |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "state") { |
|||
return { |
|||
0: "未处理", |
|||
1: "申请出库", |
|||
2: "确认出库", |
|||
3: "不能出库", |
|||
4: "取消出库", |
|||
}[row[column.property]]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
async handleDownload() { |
|||
//await this.getDownBoms(); |
|||
this.listLoading = true; |
|||
this.$axios |
|||
.gets( |
|||
"/api/settleaccount/bt-kb-not-consign/export/" + |
|||
this.customerInfo.parentId |
|||
) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.listQuery.billNum = this.customerInfo.parentId; |
|||
console.log("查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/WMSHQFKanbanoutput/WmsHQFKanbanDetailList", |
|||
this.listQuery |
|||
) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "materialCode"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 6, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
|
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
if ( |
|||
column.property === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right" }; |
|||
} else { |
|||
return { textAlign: "left" }; |
|||
} |
|||
}, |
|||
/** 通过回调控制表头style */ |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if ( |
|||
column.property === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right", background: "#FAFAFA" }; |
|||
} else { |
|||
return { textAlign: "left", background: "#FAFAFA" }; |
|||
} |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,340 @@ |
|||
<!--红旗H平台出库单--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照版本号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column |
|||
label="单据号" |
|||
prop="billNum" |
|||
sortable="custom" |
|||
align="center" |
|||
width="250px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.billNum" placement="bottom-end"> |
|||
<span class="link-type" @click="handleDrawerOpen(scope.row)">{{ |
|||
scope.row.billNum |
|||
}}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- <el-table-column type="selection" width="44px"></el-table-column> --> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable="custom" |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 导入Excel组件 --> |
|||
<importExcel |
|||
ref="importexcel" |
|||
:show="showExcelImport" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
<!-- 抽屉控件 --> |
|||
<el-drawer |
|||
title="信息详细页" |
|||
size="75%" |
|||
direction="rtl" |
|||
:visible.sync="drawer" |
|||
:before-close="handleDrawerClose" |
|||
> |
|||
<div> |
|||
<Detail |
|||
v-bind:customerInfos="customerInfos" |
|||
style="margin-top: -35px" |
|||
></Detail> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import Detail from "./detail"; |
|||
import moment from "moment"; |
|||
import importExcel from "@/components/ImportExcel-base"; |
|||
import { formatTimeToTimestamp } from "@/utils/index"; |
|||
|
|||
export default { |
|||
name: "HQH_OUTORDER", |
|||
components: { Pagination, Detail,importExcel }, |
|||
directives: { permission }, |
|||
data() { |
|||
return { |
|||
crmType: "HQ_H_OUTORDER", |
|||
rules: { |
|||
// version: [{ required: true, message: "必须输入!", trigger: "change" }], |
|||
// beginTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
// endTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
}, |
|||
customerInfos: [], |
|||
searchContent: "", // 输入内容 |
|||
drawer: false, |
|||
form: { |
|||
version: "", |
|||
customerCode: "", |
|||
customerName: "", |
|||
beginTime: "", |
|||
endTime: "", |
|||
}, |
|||
versionValue: "", |
|||
versionList: [], |
|||
startTimeVale: "", |
|||
endTimeVale: "", |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 200, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 200; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
//this.getVersionInfo(); |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 120, |
|||
}); |
|||
//tempsTabs.push({ label: "单据号", prop: "billNum", width: 150 }); |
|||
tempsTabs.push({ label: "创建人", prop: "creator", width: 160 }); |
|||
tempsTabs.push({ label: "创建时间", prop: "creationTime", width: 160 }); |
|||
tempsTabs.push({ label: "备注", prop: "remark", width: 120 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/CentralizedControl/openlist") |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.version; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
//抽屉 |
|||
handleDrawerOpen(param) { |
|||
this.drawer = true; |
|||
var parentId = param.billNum; //单据号 |
|||
var version = param.version; //版本 |
|||
this.customerInfos = [ |
|||
{ |
|||
ParentId: parentId, |
|||
Version: version, |
|||
}, |
|||
]; |
|||
}, |
|||
handleDrawerClose(done) { |
|||
done(); |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "creationTime") { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
if (column.property == "state") { |
|||
return { 0: "已提交", 1: "已出库", 2: "不能出库" }[ |
|||
row[column.property] |
|||
]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.$axios |
|||
.posts("/api/settleaccount/WMSHQFKanbanoutput/WmsHQFKanbanList", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "version"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
return { textAlign: "left" }; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,621 @@ |
|||
<!--红旗H平台出库单-明细数据--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<!-- <el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="info" |
|||
icon="el-icon-download" |
|||
@click="handleDownload()" |
|||
>导出全部 |
|||
</el-button> --> |
|||
<JobSelectVerson |
|||
:options="JobVersionList" |
|||
style="width: 150px; margin-left: -10px" |
|||
class="search-container" |
|||
@value-change="JobVersionValue" |
|||
></JobSelectVerson> |
|||
<el-button |
|||
class="filter-item" |
|||
type="success" |
|||
icon="el-icon-check" |
|||
size="mini" |
|||
@click="handleCreateBills()" |
|||
>确认出库单(支持批量)</el-button |
|||
> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
@click="handleCancelBills()" |
|||
>取消出库(支持批量) |
|||
</el-button> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照零件号搜索..." |
|||
style="width: 230px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<!--表格头组件,filter查询--> |
|||
<c-r-m-table-head |
|||
ref="crmTableHead" |
|||
:crm-type="crmType" |
|||
@handle="handleHandle" |
|||
@filter="handleFilters" |
|||
> |
|||
</c-r-m-table-head> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
:header-cell-style="headerRowStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column type="selection" width="44px"></el-table-column> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable="custom" |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import CRMTableHead from "../../../components/CRMTableHead"; |
|||
import { downloadFile } from "@/utils/crmindex.js"; |
|||
import JobSelectVerson from "@/components/CreateCom/Job-Select.vue"; |
|||
|
|||
export default { |
|||
name: "sendUnsettledDiffReport", |
|||
components: { Pagination, CRMTableHead, CRMTableHead, JobSelectVerson }, |
|||
directives: { permission }, |
|||
props: { |
|||
customerInfos: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
return { |
|||
crmType: "hq-h-OutOrder", |
|||
rules: { |
|||
//前端定义的规则,后端也有验证 |
|||
erpMaterialCode: [ |
|||
{ required: true, message: "必须输入!", trigger: "blur" }, |
|||
], |
|||
}, |
|||
searchContent: "", // 输入内容 |
|||
customerInfo: { |
|||
parentId: "", |
|||
version: "", |
|||
}, |
|||
form: { |
|||
dicDetailID: "", |
|||
customerId: "", |
|||
projectId: "", |
|||
}, |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
JobVersionList: [ |
|||
{ value: "0", label: "未处理" }, |
|||
{ value: "1", label: "申请出库" }, |
|||
{ value: "2", label: "确认出库" }, |
|||
{ value: "3", label: "不能出库" }, |
|||
{ value: "4", label: "取消出库" }, |
|||
], |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
billNum: "", |
|||
}, |
|||
listOutPutQuery: { |
|||
version: "", |
|||
guids: "", |
|||
billNum: "", |
|||
}, |
|||
page: 1, |
|||
JobversionValue: "", |
|||
JobversionValueVerson: "", |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 230, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 190; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
watch: { |
|||
customerInfos: { |
|||
handler(newVal) { |
|||
if (newVal == "" || newVal == "undefined") { |
|||
//TODO |
|||
} else { |
|||
newVal.forEach((element) => { |
|||
this.customerInfo.parentId = element.ParentId; |
|||
this.customerInfo.version = element.Version; |
|||
}); |
|||
if (this.customerInfo.parentId != "") { |
|||
this.getList(); |
|||
} |
|||
} |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
|
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 110, |
|||
}); |
|||
tempsTabs.push({ |
|||
label: "订货看板编号", |
|||
prop: "kanban", |
|||
width: 150, |
|||
}); |
|||
tempsTabs.push({ label: "交货单号", prop: "wmsBillNum", width: 110 }); |
|||
tempsTabs.push({ label: "Sap编码", prop: "materialCode", width: 150 }); |
|||
tempsTabs.push({ |
|||
label: "物料组(车型)", |
|||
prop: "materialGroup", |
|||
width: 220, |
|||
}); |
|||
tempsTabs.push({ label: "发货零件号", prop: "extend1", width: 220 }); |
|||
tempsTabs.push({ label: "收货仓库", prop: "extend2", width: 120 }); |
|||
tempsTabs.push({ label: "结算数量", prop: "qty", width: 100 }); |
|||
|
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
//版本下拉列表选择项 |
|||
JobVersionValue(params) { |
|||
//版本下拉选择 |
|||
this.listQuery.Filters = []; |
|||
var column = "state"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: params.value, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
this.getList(); |
|||
}, |
|||
//取消出库单 |
|||
handleCancelBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.$message({ |
|||
message: "至少选择一行!", |
|||
type: "warning", |
|||
}); |
|||
return; |
|||
} |
|||
var params = []; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
params.push(id); |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.guids = params; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log("取消出库条件:" + JSON.stringify(this.listOutPutQuery)); |
|||
|
|||
this.$confirm("是否确认取消出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsHQFSharePartoutput/WmsSharePartOutPut-Cancel", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "操作成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
}); |
|||
}, |
|||
//出库单 |
|||
handleCreateBills(row) { |
|||
if (this.multipleSelection.length == 0) { |
|||
this.listLoading = true; |
|||
this.listOutPutQuery.guids = []; |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log( |
|||
"未选择时全部确认出库条件:" + JSON.stringify(this.listOutPutQuery) |
|||
); |
|||
this.$confirm("是否全部确认出库?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsHQFSharePartoutput/WmsSharePartOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
this.listLoading = false; |
|||
}); |
|||
} else { |
|||
this.listLoading = true; |
|||
var params = []; |
|||
let myalert = ""; //声明变量,其变量必须在此声明后使用 |
|||
if (row) { |
|||
//单行 |
|||
params.push(row.id); |
|||
myalert = row.name; |
|||
} else { |
|||
//多选 |
|||
this.multipleSelection.forEach((element) => { |
|||
let id = element.id; |
|||
params.push(id); |
|||
}); |
|||
myalert = "选中项"; |
|||
} |
|||
this.listOutPutQuery.version = this.customerInfo.version; |
|||
this.listOutPutQuery.guids = params; |
|||
this.listOutPutQuery.billNum = this.customerInfo.parentId; |
|||
console.log( |
|||
"部分选择时确认出库条件:" + JSON.stringify(this.listOutPutQuery) |
|||
); |
|||
this.$confirm("是否确认将选中的出库" + myalert + "?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(() => { |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsHQFSharePartoutput/WmsSharePartOutPut-Pass", |
|||
this.listOutPutQuery |
|||
) |
|||
.then((response) => { |
|||
const index = this.list.indexOf(row); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "生成成功", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
this.getList(); |
|||
this.listLoading = false; |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.$message({ |
|||
type: "info", |
|||
message: "已取消操作", |
|||
}); |
|||
this.listLoading = false; |
|||
}); |
|||
} |
|||
}, |
|||
/** 刷新列表 */ |
|||
handleHandle(data) { |
|||
if (data.type !== "edit") { |
|||
this.getList(); |
|||
} |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "state") { |
|||
return { |
|||
0: "未处理", |
|||
1: "申请出库", |
|||
2: "确认出库", |
|||
3: "不能出库", |
|||
4: "取消出库", |
|||
}[row[column.property]]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
async handleDownload() { |
|||
//await this.getDownBoms(); |
|||
this.listLoading = true; |
|||
this.$axios |
|||
.gets( |
|||
"/api/settleaccount/bt-kb-not-consign/export/" + |
|||
this.customerInfo.parentId |
|||
) |
|||
.then((res) => { |
|||
let fileNameOfProject = res; |
|||
this.$axios |
|||
.BolbGets( |
|||
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|||
) |
|||
.then((response) => { |
|||
if (fileNameOfProject.indexOf("_") != -1) { |
|||
let downName = |
|||
fileNameOfProject.slice( |
|||
0, |
|||
fileNameOfProject.lastIndexOf("_") |
|||
) + |
|||
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|||
downloadFile(response, downName); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} else { |
|||
downloadFile(response, fileNameOfProject); |
|||
this.$notify({ |
|||
title: "成功", |
|||
message: "数据-导出成功!", |
|||
type: "success", |
|||
duration: 2000, |
|||
}); |
|||
} |
|||
this.listLoading = false; |
|||
}); |
|||
}); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.listQuery.billNum = this.customerInfo.parentId; |
|||
console.log("查询条件:" + JSON.stringify(this.listQuery)); |
|||
this.$axios |
|||
.posts( |
|||
"/api/settleaccount/wmsHQFSharePartoutput/WmsSharePartDetailList", |
|||
this.listQuery |
|||
) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "materialCode"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 6, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
/** 多项筛选操作 */ |
|||
/** 筛选操作 */ |
|||
handleFilters(data) { |
|||
if (data === null) { |
|||
this.listQuery.Filters = []; |
|||
this.getList(); //查询所有 |
|||
} else { |
|||
this.filterObj = data; |
|||
console.log("筛选" + JSON.stringify(data)); |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 310 : 240; |
|||
this.tableHeight = offsetHei - removeHeight; |
|||
this.currentPage = 1; |
|||
let Filter = []; |
|||
data.forEach((item) => { |
|||
let filter = {}; |
|||
if (item.formType === "datetime" || item.formType === "datetime") { |
|||
//日期类型的过滤条件是 (datetime >= a and datetime <=b) |
|||
filter["Column"] = item.fieldName; |
|||
filter["Logic"] = 0; |
|||
filter["Value"] = item.value[0]; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
|
|||
if (item.value[1] != null) { |
|||
filter["Value"] = item.value[1]; |
|||
filter["Action"] = 5; |
|||
Filter.push(filter); |
|||
} |
|||
} else { |
|||
filter["Column"] = item.fieldName; |
|||
filter["Value"] = item.value; |
|||
filter["Logic"] = 0; |
|||
filter["Action"] = item.action; |
|||
Filter.push(filter); |
|||
} |
|||
}); |
|||
console.log("筛选条件" + JSON.stringify(Filter)); |
|||
this.listQuery.Filters = Filter; |
|||
this.getList(); |
|||
} |
|||
}, |
|||
resetQuery() {}, |
|||
|
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
if ( |
|||
column.property === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right" }; |
|||
} else { |
|||
return { textAlign: "left" }; |
|||
} |
|||
}, |
|||
/** 通过回调控制表头style */ |
|||
headerRowStyle({ row, column, rowIndex, columnIndex }) { |
|||
if ( |
|||
column.property === "fisQty" || |
|||
column.property === "diffQty" || |
|||
column.property === "stockQty" |
|||
) { |
|||
return { textAlign: "right", background: "#FAFAFA" }; |
|||
} else { |
|||
return { textAlign: "left", background: "#FAFAFA" }; |
|||
} |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
|
@ -0,0 +1,340 @@ |
|||
<!--红旗H平台出库单--> |
|||
<template> |
|||
<div class="cr-body-content"> |
|||
<flexbox class="content-header"> |
|||
<el-input |
|||
v-model="searchContent" |
|||
clearable |
|||
size="small" |
|||
placeholder="按照版本号搜索..." |
|||
style="width: 200px" |
|||
class="search-container" |
|||
@keyup.enter.native="handleFilter" |
|||
/> |
|||
<el-button |
|||
size="mini" |
|||
type="success" |
|||
icon="el-icon-search" |
|||
@click="handleFilter" |
|||
>搜索 |
|||
</el-button> |
|||
<el-button |
|||
class="filter-item" |
|||
size="mini" |
|||
type="warning" |
|||
icon="el-icon-upload2" |
|||
@click="handleImportExcel()" |
|||
>导入文件(Excel) |
|||
</el-button> |
|||
</flexbox> |
|||
<!--表格渲染--> |
|||
<el-table |
|||
ref="multipleTable" |
|||
v-loading="listLoading" |
|||
element-loading-text="拼命加载中..." |
|||
element-loading-spinner="el-icon-loading" |
|||
class="cr-table" |
|||
:data="list" |
|||
:height="tableHeight" |
|||
:cell-style="cellStyle" |
|||
size="small" |
|||
stripe |
|||
border |
|||
highlight-current-row |
|||
style="width: 100%" |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
@row-click="handleRowClick" |
|||
> |
|||
<el-table-column |
|||
label="单据号" |
|||
prop="billNum" |
|||
sortable="custom" |
|||
align="center" |
|||
width="250px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-tooltip :content="scope.row.billNum" placement="bottom-end"> |
|||
<span class="link-type" @click="handleDrawerOpen(scope.row)">{{ |
|||
scope.row.billNum |
|||
}}</span> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
<!-- <el-table-column type="selection" width="44px"></el-table-column> --> |
|||
<el-table-column |
|||
v-for="(item, index) in getDefaultField" |
|||
:key="index" |
|||
:prop="item.prop" |
|||
:label="item.label" |
|||
:min-width="item.width" |
|||
:formatter="fieldFormatter" |
|||
sortable="custom" |
|||
show-overflow-tooltip |
|||
:gutter="0" |
|||
> |
|||
<template slot="header" slot-scope="scope"> |
|||
{{ scope.column.label }} |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="table-footer"> |
|||
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|||
<pagination |
|||
v-show="totalCount > 0" |
|||
:total="totalCount" |
|||
:page.sync="page" |
|||
:limit.sync="listQuery.MaxResultCount" |
|||
@pagination="getList" |
|||
/> |
|||
<!-- 导入Excel组件 --> |
|||
<importExcel |
|||
ref="importexcel" |
|||
:show="showExcelImport" |
|||
:crmType="crmType" |
|||
@close="importExcelData" |
|||
/> |
|||
<!-- 抽屉控件 --> |
|||
<el-drawer |
|||
title="信息详细页" |
|||
size="75%" |
|||
direction="rtl" |
|||
:visible.sync="drawer" |
|||
:before-close="handleDrawerClose" |
|||
> |
|||
<div> |
|||
<Detail |
|||
v-bind:customerInfos="customerInfos" |
|||
style="margin-top: -35px" |
|||
></Detail> |
|||
</div> |
|||
</el-drawer> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination |
|||
import permission from "@/directive/permission/index.js"; |
|||
import Detail from "./detail"; |
|||
import moment from "moment"; |
|||
import importExcel from "@/components/ImportExcel-base"; |
|||
import { formatTimeToTimestamp } from "@/utils/index"; |
|||
|
|||
export default { |
|||
name: "HQH_OUTORDER", |
|||
components: { Pagination, Detail,importExcel }, |
|||
directives: { permission }, |
|||
data() { |
|||
return { |
|||
crmType: "HQ_H_OUTORDER", |
|||
rules: { |
|||
// version: [{ required: true, message: "必须输入!", trigger: "change" }], |
|||
// beginTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
// endTime: [{ required: true, message: "选择日期!", trigger: "change" }], |
|||
}, |
|||
customerInfos: [], |
|||
searchContent: "", // 输入内容 |
|||
drawer: false, |
|||
form: { |
|||
version: "", |
|||
customerCode: "", |
|||
customerName: "", |
|||
beginTime: "", |
|||
endTime: "", |
|||
}, |
|||
versionValue: "", |
|||
versionList: [], |
|||
startTimeVale: "", |
|||
endTimeVale: "", |
|||
list: null, |
|||
totalCount: 0, |
|||
listLoading: true, |
|||
formLoading: false, |
|||
// 高级搜索 |
|||
filterObj: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
listQuery: { |
|||
Filters: [ |
|||
{ |
|||
logic: 0, |
|||
column: "Enabled", |
|||
action: 0, |
|||
value: "true", |
|||
}, //默认查询可用的 |
|||
], |
|||
//OrgID:"", |
|||
SkipCount: 0, |
|||
MaxResultCount: 15, |
|||
}, |
|||
page: 1, |
|||
dialogFormVisible: false, |
|||
multipleSelection: [], |
|||
formTitle: "", |
|||
drawer: false, |
|||
showExcelImport: false, |
|||
tableHeight: document.documentElement.clientHeight - 200, |
|||
isEdit: false, |
|||
}; |
|||
}, |
|||
mounted() { |
|||
var self = this; |
|||
window.onresize = function () { |
|||
var offsetHei = document.documentElement.clientHeight; |
|||
self.tableHeight = offsetHei - 200; |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
//this.getVersionInfo(); |
|||
}, |
|||
computed: { |
|||
/** 列表字段 */ |
|||
getDefaultField() { |
|||
var tempsTabs = []; |
|||
tempsTabs.push({ |
|||
label: "版本", |
|||
prop: "version", |
|||
width: 120, |
|||
}); |
|||
//tempsTabs.push({ label: "单据号", prop: "billNum", width: 150 }); |
|||
tempsTabs.push({ label: "创建人", prop: "creator", width: 160 }); |
|||
tempsTabs.push({ label: "创建时间", prop: "creationTime", width: 160 }); |
|||
tempsTabs.push({ label: "备注", prop: "remark", width: 120 }); |
|||
return tempsTabs; |
|||
}, |
|||
}, |
|||
methods: { |
|||
handleImportExcel() { |
|||
//导入 |
|||
this.showExcelImport = true; |
|||
this.$refs.importexcel.handleImportExcelClick(); |
|||
}, |
|||
getVersionInfo() { |
|||
//取版本列表信息 |
|||
this.listLoading = true; |
|||
this.listQuery.SkipCount = (this.page - 1) * 1000; |
|||
this.$axios |
|||
.posts("/api/settleaccount/CentralizedControl/openlist") |
|||
.then((response) => { |
|||
this.versionList = []; |
|||
response.forEach((element) => { |
|||
let options = {}; |
|||
options.value = element.version; |
|||
options.label = element.version; |
|||
this.versionList.push(options); |
|||
}); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
//抽屉 |
|||
handleDrawerOpen(param) { |
|||
this.drawer = true; |
|||
var parentId = param.billNum; //单据号 |
|||
var version = param.version; //版本 |
|||
this.customerInfos = [ |
|||
{ |
|||
ParentId: parentId, |
|||
Version: version, |
|||
}, |
|||
]; |
|||
}, |
|||
handleDrawerClose(done) { |
|||
done(); |
|||
}, |
|||
/** 格式化字段 */ |
|||
fieldFormatter(row, column) { |
|||
if (column.property == "creationTime") { |
|||
var date = row[column.property]; |
|||
if (date == undefined) { |
|||
return ""; |
|||
} |
|||
return moment(date).format("YYYY-MM-DD HH:mm:ss"); |
|||
} |
|||
if (column.property == "state") { |
|||
return { 0: "已提交", 1: "已出库", 2: "不能出库" }[ |
|||
row[column.property] |
|||
]; |
|||
} |
|||
return row[column.property] || "--"; |
|||
}, |
|||
importExcelData() { |
|||
//关闭导入窗体时调用 |
|||
this.showExcelImport = false; |
|||
this.getList(); |
|||
}, |
|||
getList(data) { |
|||
this.listLoading = true; |
|||
if (data != undefined) { |
|||
this.listQuery.SkipCount = (this.page - 1) * data.limit; |
|||
} else { |
|||
this.listQuery.SkipCount = (this.page - 1) * 15; |
|||
} |
|||
this.$axios |
|||
.posts("/api/settleaccount/wmsHQFSharePartoutput/WmsSharePartList", this.listQuery) |
|||
.then((response) => { |
|||
this.list = response.items; |
|||
//alert(JSON.stringify(response.Items)) |
|||
this.totalCount = response.totalCount; |
|||
setTimeout(() => { |
|||
//大数据量加载时 |
|||
this.listLoading = false; |
|||
}, 500); |
|||
}) |
|||
.catch(() => { |
|||
this.listLoading = false; |
|||
}); |
|||
}, |
|||
/** 筛选操作 */ |
|||
handleFilter() { |
|||
this.page = 1; |
|||
this.getList(); |
|||
this.listQuery.Filters = []; |
|||
if (this.searchContent != "") { |
|||
var column = "version"; |
|||
let filter = { |
|||
logic: 0, |
|||
column: column, |
|||
action: 0, |
|||
value: this.searchContent, |
|||
}; |
|||
this.listQuery.Filters.push(filter); |
|||
} |
|||
this.getList(); |
|||
}, |
|||
resetQuery() {}, |
|||
sortChange(data) { |
|||
const { prop, order } = data; |
|||
if (!prop || !order) { |
|||
this.handleFilter(); |
|||
return; |
|||
} |
|||
this.listQuery.Sorting = prop + " " + order; |
|||
this.handleFilter(); |
|||
}, |
|||
handleSelectionChange(val) { |
|||
this.multipleSelection = val; |
|||
}, |
|||
/** 通过回调控制style */ |
|||
cellStyle({ row, column, rowIndex, columnIndex }) { |
|||
return { textAlign: "left" }; |
|||
}, |
|||
handleRowClick(row, column, event) { |
|||
this.$refs.multipleTable.clearSelection(); |
|||
this.$refs.multipleTable.toggleRowSelection(row); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
|
|||
<style lang="scss" scoped> |
|||
@import "../../../styles/crmtable.scss"; |
|||
</style> |
|||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
Loading…
Reference in new issue