|
|
|
@ -1,60 +1,129 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-container style="position: relative;">
|
|
|
|
|
<el-container style="position: relative">
|
|
|
|
|
<el-header>
|
|
|
|
|
<div class="left-panel">
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
@click="page_add"
|
|
|
|
|
></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right-panel-search">
|
|
|
|
|
|
|
|
|
|
<!-- 销售订单编号,挤压编号,报工单号,型材型号,当前工序,报工日期 -->
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="search.salesOrderCode"
|
|
|
|
|
placeholder="销售单号"
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="search.scheduleNumber"
|
|
|
|
|
placeholder="挤压编号"
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="search.profileModel"
|
|
|
|
|
placeholder="型材型号"
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="search.reportNumber"
|
|
|
|
|
placeholder="报工单号"
|
|
|
|
|
clearable>
|
|
|
|
|
v-model="search.reportNumber"
|
|
|
|
|
placeholder="报工单号"
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
<dicselect v-model="search.currentProcess" :item="currentProcessItem">
|
|
|
|
|
</dicselect>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="search.date"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
placeholder="日期"
|
|
|
|
|
style="width: 600px"
|
|
|
|
|
v-model="search.reportDate"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
placeholder="报工日期"
|
|
|
|
|
style="width: 600px"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
@click="upsearch"
|
|
|
|
|
></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-header>
|
|
|
|
|
<el-main class="nopadding">
|
|
|
|
|
<scTable ref="table" :apiObj="apiObj" :column="column" :remoteFilter="config.remoteFilter" row-key="" @selection-change="selectionChange">
|
|
|
|
|
|
|
|
|
|
<scTable
|
|
|
|
|
ref="table"
|
|
|
|
|
:apiObj="apiObj"
|
|
|
|
|
:column="column"
|
|
|
|
|
:remoteFilter="config.remoteFilter"
|
|
|
|
|
row-key=""
|
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
fixed="right"
|
|
|
|
|
align="center"
|
|
|
|
|
width="120"
|
|
|
|
|
v-if="config.option"
|
|
|
|
|
>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button type="text" size="medium" @click="show_info(scope.row, scope.$index)" v-if="config.option.edit">查看</el-button>
|
|
|
|
|
<el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit && scope.row.isCompleted != '1'">完成</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="medium"
|
|
|
|
|
@click="show_info(scope.row, scope.$index)"
|
|
|
|
|
v-if="config.option.edit"
|
|
|
|
|
>查看</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="medium"
|
|
|
|
|
@click="table_edit(scope.row, scope.$index)"
|
|
|
|
|
v-if="config.option.edit && scope.row.isCompleted != '1'"
|
|
|
|
|
>完成</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</scTable>
|
|
|
|
|
</el-main>
|
|
|
|
|
<save-page ref="savePage" v-if="dialog.savePage" @closed="dialog.savePage = false" @success="handleSuccess"></save-page>
|
|
|
|
|
|
|
|
|
|
<save-page
|
|
|
|
|
ref="savePage"
|
|
|
|
|
v-if="dialog.savePage"
|
|
|
|
|
@closed="dialog.savePage = false"
|
|
|
|
|
@success="handleSuccess"
|
|
|
|
|
></save-page>
|
|
|
|
|
</el-container>
|
|
|
|
|
|
|
|
|
|
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
|
|
|
|
|
<info-dialog v-if="dialog.info" ref="infoDialog" @closed="dialog.info=false"></info-dialog>
|
|
|
|
|
<save-dialog
|
|
|
|
|
v-if="dialog.save"
|
|
|
|
|
ref="saveDialog"
|
|
|
|
|
@success="handleSuccess"
|
|
|
|
|
@closed="dialog.save = false"
|
|
|
|
|
></save-dialog>
|
|
|
|
|
<info-dialog
|
|
|
|
|
v-if="dialog.info"
|
|
|
|
|
ref="infoDialog"
|
|
|
|
|
@closed="dialog.info = false"
|
|
|
|
|
></info-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import saveDialog from './save'
|
|
|
|
|
import module from './module'
|
|
|
|
|
import config from "@/config"
|
|
|
|
|
import savePage from './savePage'
|
|
|
|
|
import infoDialog from './info'
|
|
|
|
|
import saveDialog from "./save";
|
|
|
|
|
import module from "./module";
|
|
|
|
|
import config from "@/config";
|
|
|
|
|
import savePage from "./savePage";
|
|
|
|
|
import infoDialog from "./info";
|
|
|
|
|
|
|
|
|
|
import dicselect from "@/components/scForm/items/dicselect";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
saveDialog,
|
|
|
|
|
savePage,
|
|
|
|
|
infoDialog
|
|
|
|
|
infoDialog,
|
|
|
|
|
dicselect,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -63,40 +132,41 @@ export default {
|
|
|
|
|
info: false,
|
|
|
|
|
product: false,
|
|
|
|
|
finish: false,
|
|
|
|
|
savePage: false
|
|
|
|
|
savePage: false,
|
|
|
|
|
},
|
|
|
|
|
loading:false,
|
|
|
|
|
file:"",
|
|
|
|
|
loading: false,
|
|
|
|
|
file: "",
|
|
|
|
|
search: {
|
|
|
|
|
reportNumber:"",
|
|
|
|
|
date:""
|
|
|
|
|
reportNumber: "",
|
|
|
|
|
date: "",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
apiObj:this.$API[module.name][module.list],
|
|
|
|
|
apiObj: this.$API[module.name][module.list],
|
|
|
|
|
selection: [],
|
|
|
|
|
config: module.config,
|
|
|
|
|
options: module.options,
|
|
|
|
|
column: module.column
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
|
|
|
|
|
column: module.column,
|
|
|
|
|
currentProcessItem: {
|
|
|
|
|
options: { group: "working", placeholder: "当前工序" },
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
//打开导入弹窗
|
|
|
|
|
importExcel(){
|
|
|
|
|
this.dialog.importExcel = true
|
|
|
|
|
importExcel() {
|
|
|
|
|
this.dialog.importExcel = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.importExcelDialog.open()
|
|
|
|
|
})
|
|
|
|
|
this.$refs.importExcelDialog.open();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//重置列表
|
|
|
|
|
handleReset(){
|
|
|
|
|
console.log('handleReset method called');
|
|
|
|
|
handleReset() {
|
|
|
|
|
console.log("handleReset method called");
|
|
|
|
|
// 1. 重置查询条件为初始状态
|
|
|
|
|
this.search = {};
|
|
|
|
|
var search = {
|
|
|
|
|
email: ""
|
|
|
|
|
var search = {
|
|
|
|
|
email: "",
|
|
|
|
|
}; // 根据实际情况设置默认值,如果有特定默认值,请用默认值替换 {}
|
|
|
|
|
|
|
|
|
|
// 2. 刷新表格数据
|
|
|
|
@ -106,79 +176,81 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//添加
|
|
|
|
|
add(){
|
|
|
|
|
this.dialog.save = true
|
|
|
|
|
add() {
|
|
|
|
|
this.dialog.save = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.saveDialog.open('add', this.list)
|
|
|
|
|
})
|
|
|
|
|
this.$refs.saveDialog.open("add", this.list);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
page_add() {
|
|
|
|
|
this.dialog.savePage = true
|
|
|
|
|
this.dialog.savePage = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.savePage.open('add')
|
|
|
|
|
})
|
|
|
|
|
this.$refs.savePage.open("add");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//完成
|
|
|
|
|
finish(row){
|
|
|
|
|
this.dialog.finish = true
|
|
|
|
|
finish(row) {
|
|
|
|
|
this.dialog.finish = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.finishDialog.open('add', this.list).setData(row)
|
|
|
|
|
})
|
|
|
|
|
this.$refs.finishDialog.open("add", this.list).setData(row);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//编辑
|
|
|
|
|
table_edit(row){
|
|
|
|
|
this.dialog.save = true
|
|
|
|
|
table_edit(row) {
|
|
|
|
|
this.dialog.save = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.saveDialog.open('edit', this.list).setData(row)
|
|
|
|
|
this.$refs.saveDialog.open("edit", this.list).setData(row);
|
|
|
|
|
// this.$refs.saveDialog.open('edit', this.list).setData(row)
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
show_info(row){
|
|
|
|
|
this.dialog.info = true
|
|
|
|
|
show_info(row) {
|
|
|
|
|
this.dialog.info = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.infoDialog.open().setData(row)
|
|
|
|
|
})
|
|
|
|
|
this.$refs.infoDialog.open().setData(row);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//删除
|
|
|
|
|
async table_del(row, index){
|
|
|
|
|
var reqData = {id: row[this.config.preId?this.config.preId:"id"]}
|
|
|
|
|
async table_del(row, index) {
|
|
|
|
|
var reqData = { id: row[this.config.preId ? this.config.preId : "id"] };
|
|
|
|
|
var res = await this.$API[module.name][module.del].http(reqData);
|
|
|
|
|
if(res.code == 0){
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
//这里选择刷新整个表格 OR 插入/编辑现有表格数据
|
|
|
|
|
this.$refs.table.upData();
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$alert(res.message, "提示", {type: 'error'})
|
|
|
|
|
} else {
|
|
|
|
|
this.$alert(res.message, "提示", { type: "error" });
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//批量删除
|
|
|
|
|
async batch_del(){
|
|
|
|
|
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(async () => {
|
|
|
|
|
const loading = this.$loading();
|
|
|
|
|
console.log(this.selection)
|
|
|
|
|
var idArr = [];
|
|
|
|
|
this.selection.forEach(item => {
|
|
|
|
|
idArr.push(item[this.config.preId?this.config.preId:"id"])
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var reqData = {ids: idArr.join(",")}
|
|
|
|
|
var res = await this.$API[module.name][module.del].http(reqData);
|
|
|
|
|
if(res.code == 0){
|
|
|
|
|
//这里选择刷新整个表格 OR 插入/编辑现有表格数据
|
|
|
|
|
this.$refs.table.refresh();
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
|
|
}else{
|
|
|
|
|
this.$alert(res.message, "提示", {type: 'error'})
|
|
|
|
|
}
|
|
|
|
|
loading.close();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message.success("操作失败")
|
|
|
|
|
async batch_del() {
|
|
|
|
|
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(async () => {
|
|
|
|
|
const loading = this.$loading();
|
|
|
|
|
console.log(this.selection);
|
|
|
|
|
var idArr = [];
|
|
|
|
|
this.selection.forEach((item) => {
|
|
|
|
|
idArr.push(item[this.config.preId ? this.config.preId : "id"]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var reqData = { ids: idArr.join(",") };
|
|
|
|
|
var res = await this.$API[module.name][module.del].http(reqData);
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
//这里选择刷新整个表格 OR 插入/编辑现有表格数据
|
|
|
|
|
this.$refs.table.refresh();
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
|
|
} else {
|
|
|
|
|
this.$alert(res.message, "提示", { type: "error" });
|
|
|
|
|
}
|
|
|
|
|
loading.close();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message.success("操作失败");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//表格选择后回调事件
|
|
|
|
|
selectionChange(selection){
|
|
|
|
|
selectionChange(selection) {
|
|
|
|
|
this.selection = selection;
|
|
|
|
|
},
|
|
|
|
|
filterChange(obj) {
|
|
|
|
@ -186,20 +258,20 @@ export default {
|
|
|
|
|
this.upsearch();
|
|
|
|
|
},
|
|
|
|
|
//搜索
|
|
|
|
|
upsearch(){
|
|
|
|
|
upsearch() {
|
|
|
|
|
this.$refs.table.upData(this.search);
|
|
|
|
|
},
|
|
|
|
|
//本地更新数据
|
|
|
|
|
handleSuccess(data, mode){
|
|
|
|
|
this.$refs.table.upData()
|
|
|
|
|
handleSuccess(data, mode) {
|
|
|
|
|
this.$refs.table.upData();
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.upload {
|
|
|
|
|
color: #409EFF;
|
|
|
|
|
color: #409eff;
|
|
|
|
|
background: #ecf5ff;
|
|
|
|
|
min-height: 32px;
|
|
|
|
|
padding: 9px 15px;
|
|
|
|
@ -211,5 +283,4 @@ export default {
|
|
|
|
|
.sc-upload-uploader {
|
|
|
|
|
border: none !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|