You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

512 lines
14 KiB

<!--准时化出库单-->
<template>
<div class="cr-body-content">
<flexbox class="content-header">
<!-- <XhJSSelect
:options="versionList"
style="width: 200px"
class="search-container"
@value-change="selectValue"
></XhJSSelect> -->
<el-input
v-model="searchContent"
clearable
size="small"
placeholder="按照单据号搜索..."
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="searchVersion"
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 icon="el-icon-refresh" size="mini" @click="resetQuery()"
>重置</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"
@cell-dblclick="dblhandleCurrentChange"
>
<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-column label="备注" width="400" align="center">
<template slot-scope="scope">
<el-input
ref="inputRef"
v-if="scope.row.isEditCell"
v-model="scope.row.remark"
class="el-input"
v-focus
@blur="cellBlur(scope.row, scope.column)"
/>
<span v-else>{{ scope.row.remark }}</span>
<el-button
style="margin-left: 5px"
v-if="scope.row.isEditCell"
type="success"
icon="el-icon-check"
size="small"
circle
@click="submitName(scope.row)"
></el-button>
<el-button
v-show="scope.row.isEditCell"
class="cancel-btn"
size="mini"
icon="el-icon-refresh"
type="warning"
@click.native.prevent="handleCancel(scope.row)"
>
cancel
</el-button>
</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"
ref="detailDrawer"
>
<div>
<Detail
v-bind:customerInfos="customerInfos"
@Change="drawerclose"
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";
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue";
export default {
name: "sendUnsettledDiffReport",
components: { Pagination, Detail, importExcel, XhJSSelect },
directives: { permission },
data() {
return {
crmType: "vwoutorder",
rules: {
// version: [{ required: true, message: "必须输入", trigger: "change" }],
// beginTime: [{ required: true, message: "选择日期", trigger: "change" }],
// endTime: [{ required: true, message: "选择日期", trigger: "change" }],
},
customerInfos: [],
searchContent: "", // 输入内容
searchVersion: "", // 输入内容
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: "sumContent", width: 160 });
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: {
drawerclose(param) {
if (param == "删除成功") {
this.$refs.detailDrawer.closeDrawer();
this.getList();
}
},
selectValue(params) {
//版本下拉选择
this.versionValue = params.value;
this.getList();
},
dblhandleCurrentChange(row, column, cell, event) {
if (column.label === "备注") {
row.isEditCell = true;
this.$set(row, "isEditCell", true);
this.$nextTick(() => {
this.$refs["inputRef"].focus();
});
}
this.list = this.list.filter((item) => {
return item;
});
},
// 可以编辑框失去焦点
cellBlur(row, column) {
row.isEditCell = false;
this.$set(row, "isEditCell", false);
},
// 在线编辑中提交
submitName(row) {
let getguid = row.id;
let getremark = row.remark;
this.$axios
.gets("/api/settleaccount/wmsjitoutput/UpdateRemark", {
id: getguid,
remark: getremark,
})
.then((response) => {
if (response == true) {
this.$notify({
title: "成功",
message: "更新成功",
type: "success",
duration: 2000,
});
this.getList();
}
})
.catch(() => {
this.listLoading = false;
});
},
// 取消
handleCancel(row) {
row.isEditCell = false;
//row.stockQty = row.originalstockQty;
this.$set(row, "isEditCell", false);
// this.$message({
// message: "取消后恢复当前原值",
// type: "warning",
// });
this.getList();
},
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;
// });
// },
getVersionInfo() {
//取版本列表信息
this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 1000;
this.$axios
.posts("/api/settleaccount/wmsjitoutput/WmsJitList", this.listQuery)
.then((response) => {
this.versionList = [];
response.items.forEach((element) => {
let options = {};
options.value = element.id;
options.label = element.version;
this.versionList.push(options);
});
if (JSON.stringify(this.versionList) != "[]") {
//因版本下拉有默认值,所以详表要自动绑定子表数据
this.versionValueVerson = this.versionList[0].label;
this.getList();
}
})
.catch(() => {
this.listLoading = false;
});
},
//抽屉
handleDrawerOpen(param) {
this.drawer = true;
var billnum = param.billNum; //单据号
var version = param.version; //版本
this.customerInfos = [
{
ParentId: billnum,
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/wmsjitoutput/WmsJitList", this.listQuery)
.then((response) => {
this.list = response.items;
//alert(JSON.stringify(response.Items))
this.totalCount = response.totalCount;
//动态加一个是否编辑的标识
this.list.forEach((element) => {
element["isEditCell"] = false;
});
setTimeout(() => {
//大数据量加载时
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
/** 筛选操作 */
handleFilter() {
this.page = 1;
this.getList();
let Filter = [];
if (this.searchContent != "") {
var column = "billNum";
let filter = {
logic: 0,
column: column,
action: 6,
value: this.searchContent,
};
Filter.push(filter);
}
if (this.searchVersion != "") {
var column = "version";
let filter = {
logic: 0,
column: column,
action: 6,
value: this.searchVersion,
};
Filter.push(filter);
}
console.log("筛选条件" + JSON.stringify(Filter));
this.listQuery.Filters = Filter;
this.getList();
},
resetQuery() {
this.searchContent = "";
this.searchVersion = "";
this.listQuery.Filters = [];
this.listQuery.SkipCount = 1;
this.getList();
},
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 === "sumContent") {
return { textAlign: "left", "font-weight": 700, color: "#FF6100" };
} else {
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>