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