667 lines
18 KiB
Plaintext
667 lines
18 KiB
Plaintext
<template>
|
||
<div class="app-container">
|
||
<div class="main">
|
||
<query-params
|
||
ref="query"
|
||
:form="queryFormConfig"
|
||
@handleQuery="handleQuery"
|
||
@getTableData="getTableData"
|
||
@resetQuery="resetQuery"
|
||
>
|
||
</query-params>
|
||
<el-divider></el-divider>
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
icon="el-icon-plus"
|
||
size="mini"
|
||
@click="OpenSolder"
|
||
v-hasPermi="['solderPaste_import']"
|
||
>锡膏入库
|
||
</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="success"
|
||
icon="el-icon-setting"
|
||
size="mini"
|
||
v-hasPermi="['solderPaste_manage']"
|
||
:disabled="clearShow"
|
||
@click="goDetail"
|
||
>锡膏管理
|
||
</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="danger"
|
||
icon="el-icon-delete"
|
||
size="mini"
|
||
:disabled="clearShow"
|
||
@click="handleDelete"
|
||
v-hasPermi="['solderPaste_del']"
|
||
>删除
|
||
</el-button>
|
||
</el-col>
|
||
|
||
<el-popover
|
||
style="float: right"
|
||
placement="bottom-end"
|
||
title="自定义显示列"
|
||
width="250"
|
||
@show="initPopover"
|
||
trigger="hover"
|
||
>
|
||
<headConfig
|
||
ref="test"
|
||
@fathers="fathers"
|
||
:propThis="propThis"
|
||
></headConfig>
|
||
<el-button
|
||
style="margin-right:5px;"
|
||
size="mini"
|
||
type="primary"
|
||
class="el-icon-caret-bottom"
|
||
slot="reference"
|
||
>自定义列</el-button
|
||
>
|
||
</el-popover>
|
||
</el-row>
|
||
|
||
<el-row :gutter="10" style="margin: 10px 0px;" class="mb8" v-if="isSortShow">
|
||
<el-col>
|
||
<el-select
|
||
ref="select"
|
||
@click.native="notSelect"
|
||
style="width: 100%"
|
||
v-model="seqence"
|
||
:multiple="true"
|
||
placeholder=""
|
||
>
|
||
<el-option
|
||
v-for="item in seqenceOptions"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value"
|
||
>
|
||
</el-option>
|
||
</el-select>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
<el-table
|
||
@sort-change="sortChange"
|
||
@header-dragend="headerDragend"
|
||
highlight-current-row
|
||
@current-change="handleCurrentChange"
|
||
:data="tableData"
|
||
border
|
||
v-if="indexShow"
|
||
:height="tableHeight"
|
||
class="tableStyle"
|
||
style="width: 100%"
|
||
>
|
||
<el-table-column type="index" align="center" label="序号" width="50">
|
||
</el-table-column>
|
||
|
||
<el-table-column
|
||
v-for="(item, index) in realList"
|
||
:sortable="item.notSort == true ? false : `custom`"
|
||
:prop="item.tableProp"
|
||
:key="index"
|
||
:align="item.align"
|
||
header-align="center"
|
||
:min-width="item.width"
|
||
:label="item.tableTitle"
|
||
:show-overflow-tooltip="item.show_overflow_tooltip"
|
||
>
|
||
</el-table-column>
|
||
</el-table>
|
||
<el-pagination
|
||
style="margin-top: 10px;height: 20px"
|
||
@size-change="handleSizeChange"
|
||
@current-change="handleCurrentChange2"
|
||
:current-page="currentPage"
|
||
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
|
||
:page-size="pageSize"
|
||
layout="total, sizes, prev, pager, next, jumper"
|
||
:total="total"
|
||
>
|
||
</el-pagination>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import SolderPasteVue from "./SolderPaste.vue";
|
||
export default {
|
||
name: "solderPaste",
|
||
mounted() {
|
||
let tempList = this.$headerConfig.getList("solderPaste");
|
||
this.seqenceOptions = [];
|
||
tempList.forEach((data, index) => {
|
||
if (data.notSort) return;
|
||
let temp = {
|
||
value: null,
|
||
label: null,
|
||
};
|
||
|
||
temp.value = data.tableProp.replace("Show", "") + " ascending";
|
||
temp.label = data.tableTitle + " 升序";
|
||
|
||
this.seqenceOptions.push(temp);
|
||
|
||
let tempD = {
|
||
value: null,
|
||
label: null,
|
||
};
|
||
|
||
tempD.value = data.tableProp.replace("Show", "") + " descending";
|
||
tempD.label = data.tableTitle + " 降序";
|
||
|
||
this.seqenceOptions.push(tempD);
|
||
});
|
||
|
||
this.$nextTick(() => {
|
||
this.tableHeight =
|
||
window.innerHeight - this.$refs.query.offsetHeight - 210;
|
||
});
|
||
|
||
this.getList();
|
||
const params = {
|
||
tableName: "solderPaste",
|
||
};
|
||
this.$headerConfig.getRealList(params).then((data) => {
|
||
if (data.data.data !== null) {
|
||
let temp = JSON.parse(data.data.data);
|
||
this.realList = temp.headerList;
|
||
this.List = temp.List;
|
||
} else {
|
||
this.List = this.$headerConfig.getList("solderPaste");
|
||
this.realList = this.List;
|
||
let temp = {
|
||
headerList: this.realList,
|
||
List: this.List,
|
||
};
|
||
const params = {
|
||
tableName: "solderPaste",
|
||
configure: JSON.stringify(temp),
|
||
};
|
||
this.$headerConfig.updateRealList(params).then((value) => {
|
||
console.log("执行了吗");
|
||
console.log(value);
|
||
});
|
||
}
|
||
this.indexShow = true;
|
||
});
|
||
this.$refs.query.init()
|
||
},
|
||
computed:{
|
||
queryFormConfig()
|
||
{
|
||
return{
|
||
controlList:[
|
||
{
|
||
key:'materialCode',
|
||
label:'物料编码',
|
||
type:'input',
|
||
placeholder:'请输入',
|
||
prop:'materialCode',
|
||
class:'width_0180'
|
||
},
|
||
{
|
||
key:'materialName',
|
||
label:'物料名称',
|
||
type:'input',
|
||
placeholder:'请输入',
|
||
prop:'materialName',
|
||
class:'width_0180'
|
||
},
|
||
{
|
||
key:'materialSpec',
|
||
label:'物料规格',
|
||
type:'input',
|
||
placeholder:'请输入',
|
||
prop:'materialSpec',
|
||
class:'width_0180'
|
||
},
|
||
{
|
||
key:'dictUsageStatus',
|
||
label: '使用状态',
|
||
type: 'select',
|
||
placeholder: '请选择',
|
||
prop: 'dictUsageStatus',
|
||
options: this.$dictType.getusageArrStatus(),
|
||
optionLabel:'text',
|
||
optionValue:'key'
|
||
},
|
||
{
|
||
key:"value1",label: '有效期', type: 'datetimerange', startPlaceholder:"有效期始",endPlaceholder:"有效期终", prop: 'value1',
|
||
},
|
||
],
|
||
config:{
|
||
//零散的配置参数
|
||
hasAdvQuery:false,//有无高级查询
|
||
storageMode:true,//记忆模式,开启后每次查询会存储到localstorage中,存储名为下面的storageKey
|
||
storageKey:"solderPaste",
|
||
propThis:this,//this
|
||
preFixWidthClass:'width_0100', //前置框的宽度calss,不写则为默认100
|
||
marginWidthClass:'width_0180' //空白选择框的宽度calss,不写则为默认180
|
||
},
|
||
defaultList: [
|
||
//默认展示的属性,跟controList里面的key相对应
|
||
'materialCode','materialName','materialSpec',//'planStartDtArray',
|
||
],
|
||
}
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
seqence: [],
|
||
seqenceOptions: [],
|
||
showMore: false,
|
||
|
||
form: {
|
||
dictUsageStatus: "",
|
||
},
|
||
formLabelWidth: "120px",
|
||
childrenList: [],
|
||
currentRow: null,
|
||
List: [],
|
||
indexShow: false,
|
||
realList: [],
|
||
isAdd: null,
|
||
total: null,
|
||
propThis: this,
|
||
pageSize: 50,
|
||
tableHeight: 0,
|
||
clearShow: true,
|
||
currentPage: 1,
|
||
tableData: [],
|
||
queryParams: {},
|
||
loading: false,
|
||
sonListLoading: true,
|
||
selectArr: [],
|
||
isSortShow: false,
|
||
};
|
||
},
|
||
methods: {
|
||
notSelect() {
|
||
this.$refs.select.blur();
|
||
},
|
||
//展开更多
|
||
showMoreChange() {
|
||
if (!this.showMore) this.tableHeight = this.tableHeight - 70;
|
||
else {
|
||
this.tableHeight = this.tableHeight + 70;
|
||
}
|
||
this.$nextTick(() => {
|
||
this.showMore = !this.showMore;
|
||
});
|
||
},
|
||
sortChange({ column, prop, order }) {
|
||
console.log(prop);
|
||
let sTemp = {
|
||
value: null,
|
||
label: null,
|
||
};
|
||
let value = prop.replace("Show", "") + " " + order;
|
||
let judgeValue = value.split(" ");
|
||
if (this.seqence.length === 0) {
|
||
this.seqence.push(value);
|
||
console.log(this.seqence);
|
||
} else {
|
||
for (let i = 0; i < this.seqence.length; i++) {
|
||
let judgeSeqence = this.seqence[i].split(" ");
|
||
if (judgeValue[0] === judgeSeqence[0]) {
|
||
if (judgeValue[1] === "null") {
|
||
return;
|
||
}
|
||
this.seqence.splice(i, 1, value);
|
||
console.log(this.seqence);
|
||
return;
|
||
}
|
||
if (i + 1 === this.seqence.length) {
|
||
this.seqence.push(value);
|
||
console.log(this.seqence);
|
||
}
|
||
}
|
||
}
|
||
},
|
||
OpenSolder() {
|
||
this.$layer.iframe({
|
||
shadeClose: false,
|
||
content: {
|
||
content: SolderPasteVue, //传递的组件对象
|
||
parent: this, //当前的vue对象
|
||
shadeClose: false,
|
||
},
|
||
title: "锡膏入库",
|
||
});
|
||
},
|
||
|
||
headerDragend(newWidth, oldWidth, column, event) {
|
||
// realList
|
||
this.realList.forEach((value) => {
|
||
if (column.property == value.tableProp) {
|
||
value.width = newWidth;
|
||
}
|
||
});
|
||
this.$refs.test.init();
|
||
setTimeout(() => {
|
||
this.$refs.test.show();
|
||
}, 1000);
|
||
},
|
||
|
||
clearThis() {
|
||
this.$confirm("是否确认清空该锡膏", "提示", {
|
||
confirmButtonText: "确定",
|
||
cancelButtonText: "取消",
|
||
type: "warning",
|
||
})
|
||
.then(() => {
|
||
this.$solderPaste
|
||
.clearThis({ id: this.currentRow.id })
|
||
.then((data) => {
|
||
if (data.data.code == 200) {
|
||
this.$message.success("更新成功");
|
||
this.getList();
|
||
}
|
||
});
|
||
})
|
||
.catch(() => {});
|
||
},
|
||
goDetail() {
|
||
this.$store.commit("comitmaterialBarBox", this.currentRow.materialBar);
|
||
this.$router.push({ path: "SolderPasteList" });
|
||
},
|
||
getList() {
|
||
const orders = [];
|
||
this.seqence.map((val) => {
|
||
orders.push(
|
||
val.replace("ascending", "asc").replace("descending", "desc")
|
||
);
|
||
});
|
||
|
||
|
||
const params = {
|
||
pageSize: this.pageSize,
|
||
pageNo: this.currentPage,
|
||
materialCode: this.queryParams.materialCode,
|
||
materialName: this.queryParams.materialName,
|
||
materialSpec: this.queryParams.materialSpec,
|
||
dictStageStatus: this.queryParams.dictStageStatus,
|
||
dictUsageStatus: this.queryParams.dictUsageStatus,
|
||
|
||
orders: orders,
|
||
};
|
||
if(this.queryParams.value1!=undefined && this.queryParams.value1!=null)
|
||
{
|
||
params.expireTimeStart=this.g_method.dateFtt("yyyy-MM-dd hh:mm:ss", this.queryParams.value1[0]),
|
||
params.expireTimeEnd=this.g_method.dateFtt("yyyy-MM-dd hh:mm:ss", this.queryParams.value1[1])
|
||
|
||
}
|
||
// if (this.value1) {
|
||
// } else {
|
||
// const params = {
|
||
// pageSize: this.pageSize,
|
||
// pageNo: this.currentPage,
|
||
// materialCode: this.queryParams.materialCode,
|
||
// materialName: this.queryParams.materialName,
|
||
// materialSpec: this.queryParams.materialSpec,
|
||
// dictStageStatus: this.queryParams.dictStageStatus,
|
||
// dictUsageStatus: this.queryParams.dictUsageStatus,
|
||
// };
|
||
// }
|
||
|
||
this.loading = true;
|
||
this.$solderPaste.getList(params).then((data) => {
|
||
if (data.data.code == 200) {
|
||
data.data.data.data.forEach((e) => {
|
||
if (e.isPb == 1) {
|
||
e.isPbShow = "是";
|
||
} else if (e.isPb == 0) {
|
||
e.isPbShow = "否";
|
||
}
|
||
|
||
e.dictUsageStatusShow = this.$dictType.getusageStatus(
|
||
e.dictUsageStatus
|
||
);
|
||
});
|
||
this.tableData = data.data.data.data;
|
||
this.total = data.data.data.recordsTotal;
|
||
this.loading = false;
|
||
} else {
|
||
this.$message.error(data.message);
|
||
this.loading = false;
|
||
}
|
||
});
|
||
},
|
||
initPopover() {
|
||
const params = {
|
||
tableName: "solderPaste",
|
||
};
|
||
this.$headerConfig.getRealList(params).then((data) => {
|
||
console.log("开始输出真正表格");
|
||
let temp = JSON.parse(data.data.data);
|
||
console.log(temp);
|
||
this.realList = temp.headerList;
|
||
console.log(this.realList);
|
||
this.$refs.test.init();
|
||
});
|
||
},
|
||
fathers(data) {
|
||
this.List = data.configure.List;
|
||
data.configure.List.forEach((value) => {
|
||
this.realList.forEach((real) => {
|
||
if (value.tableProp == real.tableProp) {
|
||
value.width = real.width;
|
||
}
|
||
});
|
||
});
|
||
|
||
data.configure.headerList.forEach((value) => {
|
||
this.realList.forEach((real) => {
|
||
if (value.tableProp == real.tableProp) {
|
||
value.width = real.width;
|
||
}
|
||
});
|
||
});
|
||
if (data.configure.headerList.length <= 0) {
|
||
return;
|
||
}
|
||
const params = {
|
||
tableName: "solderPaste",
|
||
configure: JSON.stringify(data.configure),
|
||
};
|
||
|
||
this.realList = data.configure.headerList;
|
||
|
||
this.$headerConfig.updateRealList(params).then((value) => {
|
||
console.log(value);
|
||
});
|
||
},
|
||
|
||
handleCurrentChange2(val) {
|
||
this.currentPage = val;
|
||
this.getList();
|
||
},
|
||
handleSizeChange(val) {
|
||
this.pageSize = val;
|
||
this.getList();
|
||
},
|
||
handleCurrentChange(val) {
|
||
this.currentRow = val;
|
||
this.clearShow = false;
|
||
},
|
||
Query() {
|
||
this.currentPage = 1;
|
||
this.getList();
|
||
},
|
||
// /** 重置按钮操作 */
|
||
resetQuery() {
|
||
|
||
},
|
||
getQueryParams()
|
||
{
|
||
let pageSize=this.queryParams.pageSize
|
||
let pageNo=this.queryParams.pageNo
|
||
this.queryParams=this.$refs.query.getQueryParams()//返回子组件的queryParams
|
||
this.queryParams.pageSize=pageSize
|
||
this.queryParams.pageNo=pageNo
|
||
//取得子组件的queryParams并且与原来的pagesize pageNo合并
|
||
},
|
||
/** 搜索按钮操作 */
|
||
handleQuery() {
|
||
this.getQueryParams()
|
||
this.queryParams.pageNo = 1;
|
||
this.getList();
|
||
|
||
},
|
||
|
||
// 多选框选中数据
|
||
handleSelectionChange(selection) {
|
||
this.rows = selection;
|
||
this.single = selection.length != 1;
|
||
this.multiple = !selection.length;
|
||
},
|
||
getTableData(val) {
|
||
//高级查询
|
||
this.queryData = val
|
||
this.tableData=this.queryData.data
|
||
this.tableData.forEach((value) => {
|
||
value.materialNumber=value.materialCode
|
||
value.dictStatusShow = this.$dictType.getOrderWorkStatus(
|
||
value.dictStatus
|
||
);
|
||
value.dictFlowtypeShow = this.$dictType.getMaterialFlowType(
|
||
value.dictFlowtype
|
||
);
|
||
value.dictPtypeShow = this.$dictType.getOrderPtypeType(
|
||
value.dictPtype
|
||
);
|
||
|
||
value.dictPstatusShow = this.$dictType.getWorkPStatus(value.dictPstatus);//领料状态
|
||
});
|
||
this.total=this.queryData.recordsTotal
|
||
// this.getBomlList()
|
||
|
||
},
|
||
|
||
handleDelete() {
|
||
this.$confirm("是否确认删除该锡膏", "提示", {
|
||
confirmButtonText: "确定",
|
||
cancelButtonText: "取消",
|
||
type: "warning",
|
||
})
|
||
.then(() => {
|
||
// let arr = [];
|
||
// this.selectArr.forEach((e, i) => {
|
||
// arr.push(e.id);
|
||
// });
|
||
|
||
//跳转到引用
|
||
// this.$solderPaste.deleteThis(arr).then((data) => {
|
||
let parmas = {
|
||
id: this.currentRow.id,
|
||
};
|
||
this.$solderPaste.deleteThis(parmas).then((data) => {
|
||
if (data.data.code == 200) {
|
||
this.$message.success("删除成功");
|
||
this.getList();
|
||
}
|
||
});
|
||
})
|
||
.catch(() => {});
|
||
},
|
||
},
|
||
watch: {
|
||
seqence: function () {
|
||
this.getList();
|
||
var oldIsSortShow = this.isSortShow
|
||
//判断是否显示排序条件
|
||
if(this.seqence.length > 0 ){
|
||
this.isSortShow = true
|
||
}else{
|
||
this.isSortShow = false
|
||
}
|
||
//判断table高度
|
||
if(oldIsSortShow != this.isSortShow){
|
||
if (this.isSortShow) {
|
||
this.tableHeight = this.tableHeight - 47;
|
||
} else {
|
||
this.tableHeight = this.tableHeight + 47;
|
||
}
|
||
}
|
||
},
|
||
},
|
||
};
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
>>> .el-form-item {
|
||
padding: 0px;
|
||
margin: 0px;
|
||
}
|
||
|
||
>>> .vue-treeselect__control {
|
||
height: 20px;
|
||
line-height: 28px;
|
||
}
|
||
|
||
>>> .el-divider {
|
||
margin: 1px;
|
||
}
|
||
|
||
>>> .el-table__body tr.current-row > td {
|
||
background-color: #8ac1ff !important;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.el-table >>> tbody tr:hover > td {
|
||
background-color: #8ac1ff !important;
|
||
}
|
||
.mb8 >>> .el-select .el-input__inner {
|
||
border: 0px;
|
||
}
|
||
|
||
.mb8 >>> .el-select .el-input__inner {
|
||
border: 0px;
|
||
padding-right: 35px;
|
||
}
|
||
|
||
.sortSeq >>> .el-input__suffix-inner {
|
||
display: none;
|
||
}
|
||
>>> .el-form-item {
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.el-divider {
|
||
margin-top: 0px;
|
||
margin-bottom: 5px;
|
||
}
|
||
|
||
>>> .el-table .el-table__header-wrapper th {
|
||
padding: 5px 0;
|
||
}
|
||
>>> .vue-treeselect__control {
|
||
height: 30px !important;
|
||
line-height: 30px !important;
|
||
}
|
||
>>> .vue-treeselect--single .vue-treeselect__input-container {
|
||
height: 30px !important;
|
||
line-height: 30px !important;
|
||
}
|
||
// >>> .el-input-group__append{
|
||
// padding: 5px;
|
||
// }
|
||
>>> .el-input-group__append .el-select,
|
||
.el-input-group__append .el-button,
|
||
.el-input-group__prepend .el-select,
|
||
.el-input-group__prepend .el-button {
|
||
margin-left: -28px !important;
|
||
margin-right: -33px !important;
|
||
}
|
||
</style>
|