fengcang
anthonyywj2 3 years ago
parent e61fd5ff2a
commit 4d2bbb7258

@ -120,11 +120,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<!-- <el-table-column label="采购类型">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.type | typeFilterName }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" width="200"> <el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button

@ -104,11 +104,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<!-- <el-table-column label="采购类型">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.type | typeFilterName }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" width="200"> <el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->

@ -61,6 +61,9 @@
<span>{{ getStorageName(scope.row.locStorageCode) }}</span> <span>{{ getStorageName(scope.row.locStorageCode) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="actDate" prop="actDate"
@ -72,24 +75,6 @@
<span>{{ scope.row.actDate }}</span> <span>{{ scope.row.actDate }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column-->
<!-- label="审核时间"-->
<!-- prop="actDate"-->
<!-- width="150"-->
<!-- show-overflow-tooltip="true"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <i class="el-icon-time"></i>-->
<!-- <span>{{ scope.row.auditTime }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="校验状态" prop="contrastStatus" width="120">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag :type="(scope.row.contrastStatus === 1) | statusFilterType">-->
<!-- {{ erpCheckStatus[scope.row.contrastStatus] }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -237,368 +222,368 @@
</template> </template>
<script> <script>
import {filterOrderForDelete, orderDetail, deleteByOrderId, updateOrderInfo} from "../../api/inout/order"; import {filterOrderForDelete, orderDetail, deleteByOrderId, updateOrderInfo} from "../../api/inout/order";
import store from "../../store"; import store from "../../store";
import {getBussinessType} from "../../api/basic/bussinessType"; import {getBussinessType} from "../../api/basic/bussinessType";
import {filterAllByUser} from "../../api/basic/invWarehouse"; import {filterAllByUser} from "../../api/basic/invWarehouse";
import codeReplace from "./codeReplace"; import codeReplace from "./codeReplace";
export default { export default {
name: "stockOrderDelete", name: "stockOrderDelete",
data() { data() {
return { return {
query: { query: {
billNo: "", billNo: "",
page: 1, page: 1,
limit: 10 limit: 10
},
detailQuery: {
orderIdFk: "",
page: 1,
limit: 20
},
busTypes: [],
list: [],
detailList: [],
currentCheckIndex: -1,
multipId: [],
formLabelWidth: '150px',
total: 0,
detailTotal: 0,
storageList: [],
loading: false,
detailLoading: false,
idQuery: {
id: "",
},
sourceMap: {
"1": "web端新增单据",
"2": "第三方系统",
"3": "扫码单据转换",
},
fromTypeMap: {
"1": "UDIMS平台",
"2": "网页新增",
"3": "pda即时校验",
"4": "pda未校验",
"5": "pc端扫码精灵",
"6": "缺量补录单据",
"7": "UDI供应商平台",
"8": "平衡补录单据",
},
erpCheckStatus: {
// error: "",
// null: "",
// success: "",
1: "校验异常",
0: "未校验",
2: "校验成功",
},
isSp: store.getters.customerId,
detailFormData: {},
detailFormLoading: false,
actDateRange: [],
curRow: null,
codeDetailVisible: false,
editOrderVisible: false,
actDate: null, //
auditTime: null, //
orderIds: [],
pickerOptions: {
disabledDate: time => {
let endDate = new Date().getTime();
let nowDate = new Date(time).getTime();
return (nowDate > endDate);
}
}
}
},
methods: {
onReset() {
this.$router.push({
path: ""
});
this.query = {
billNo: ""
};
this.list = [];
this.detailList = [];
this.actDateRange = [];
}, },
onSubmit() { detailQuery: {
this.getList(); orderIdFk: "",
page: 1,
limit: 20
}, },
handleCurrentChange(val) { busTypes: [],
this.query.page = val; list: [],
this.getList(); detailList: [],
currentCheckIndex: -1,
multipId: [],
formLabelWidth: '150px',
total: 0,
detailTotal: 0,
storageList: [],
loading: false,
detailLoading: false,
idQuery: {
id: "",
}, },
sourceMap: {
changeFun(row) { "1": "web端新增单据",
let _this = this; "2": "第三方系统",
_this.multipId = []; //ID "3": "扫码单据转换",
row.forEach((item) => {
_this.multipId.push(item.id);
})
}, },
detailHandleCurrentChange(val) { fromTypeMap: {
this.query.page = val; "1": "UDIMS平台",
this.getOrderDetailList(); "2": "网页新增",
"3": "pda即时校验",
"4": "pda未校验",
"5": "pc端扫码精灵",
"6": "缺量补录单据",
"7": "UDI供应商平台",
"8": "平衡补录单据",
}, },
// erpCheckStatus: {
resetForm() { // error: "",
if (this.$refs["dataForm"]) { // null: "",
// // success: "",
this.$refs["dataForm"].clearValidate(); 1: "校验异常",
// 0: "未校验",
this.$refs["dataForm"].resetFields(); 2: "校验成功",
this.getList();
}
},
getList() {
this.query.billNo = this.query.billNo.trim();
if (this.query.billNo === null || this.query.billNo === "") {
this.$message.warning("请输入需要查询的单号");
} else {
this.loading = true;
filterOrderForDelete(this.query)
.then(response => {
this.loading = false;
this.list = response.data.list || [];
this.detailList = [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
this.detailList = [];
});
}
}, },
getOrderDetailList(row) { isSp: store.getters.customerId,
if (this.$isNotBlank(row)) { detailFormData: {},
this.detailQuery.orderId = row.id; detailFormLoading: false,
this.detailQuery.orderIdFk = row.id; actDateRange: [],
curRow: null,
codeDetailVisible: false,
editOrderVisible: false,
actDate: null, //
auditTime: null, //
orderIds: [],
pickerOptions: {
disabledDate: time => {
let endDate = new Date().getTime();
let nowDate = new Date(time).getTime();
return (nowDate > endDate);
} }
this.detailLoading = true; }
orderDetail(this.detailQuery) }
.then((response) => { },
this.detailLoading = false; methods: {
this.detailList = response.data || []; onReset() {
this.$router.push({
path: ""
});
this.query = {
billNo: ""
};
this.list = [];
this.detailList = [];
this.actDateRange = [];
},
onSubmit() {
this.getList();
},
handleCurrentChange(val) {
this.query.page = val;
this.getList();
},
changeFun(row) {
let _this = this;
_this.multipId = []; //ID
row.forEach((item) => {
_this.multipId.push(item.id);
})
},
detailHandleCurrentChange(val) {
this.query.page = val;
this.getOrderDetailList();
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
getList() {
this.query.billNo = this.query.billNo.trim();
if (this.query.billNo === null || this.query.billNo === "") {
this.$message.warning("请输入需要查询的单号");
} else {
this.loading = true;
filterOrderForDelete(this.query)
.then(response => {
this.loading = false;
this.list = response.data.list || [];
this.detailList = [];
this.total = response.data.total || 0;
}) })
.catch(() => { .catch(() => {
this.detailLoading = false; this.loading = false;
this.list = [];
this.total = 0;
this.detailList = []; this.detailList = [];
}); });
}, }
tableRowClassName({row, rowIndex}) { },
if (rowIndex === 0) { getOrderDetailList(row) {
return 'highlight-row'; if (this.$isNotBlank(row)) {
this.detailQuery.orderId = row.id;
this.detailQuery.orderIdFk = row.id;
}
this.detailLoading = true;
orderDetail(this.detailQuery)
.then((response) => {
this.detailLoading = false;
this.detailList = response.data || [];
})
.catch(() => {
this.detailLoading = false;
this.detailList = [];
});
},
tableRowClassName({row, rowIndex}) {
if (rowIndex === 0) {
return 'highlight-row';
}
return '';
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
} }
return ''; }
}, },
getActionName(action) { getBusType() {
for (let i = 0; i < this.busTypes.length; i++) { let query = {
if (this.busTypes[i].action === action) { enabled: true,
return this.busTypes[i].name; };
} getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
})
.catch(() => {
});
},
getStorageName(code) {
for (let i = 0; i < this.storageList.length; i++) {
if (this.storageList[i].code === code) {
return this.storageList[i].name;
} }
}, }
getBusType() { },
let query = { getStorage() {
enabled: true, this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
deleteOrder(row) {
this.$confirm('是否确认删除单据及相关数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: row.id
}; };
getBussinessType(query) deleteByOrderId(params).then((res) => {
.then((response) => { if (res.code === 20000) {
this.busTypes = response.data.list || []; this.$message({
}) type: 'success',
.catch(() => { message: '删除成功!'
}); });
}, this.getList();
getStorageName(code) { this.detailList = [];
for (let i = 0; i < this.storageList.length; i++) {
if (this.storageList[i].code === code) {
return this.storageList[i].name;
} }
} }).catch((error) => {
}, this.$message.error("删除失败");
getStorage() {
this.storageList = [];
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
deleteOrder(row) {
this.$confirm('是否确认删除单据及相关数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: row.id
};
deleteByOrderId(params).then((res) => {
if (res.code === 20000) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getList();
this.detailList = [];
}
}).catch((error) => {
this.$message.error("删除失败");
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
}); });
}, }).catch(() => {
deleteAllOrder() { this.$message({
if (this.query.billNo === null || this.query.billNo === "" || this.list.length === 0) { type: 'info',
return; message: '已取消删除'
} });
this.$confirm("是否确认删除此单据及所有关联单据?", "提示", { });
confirmButtonText: '确定', },
cancelButtonText: '取消', deleteAllOrder() {
type: 'warning' if (this.query.billNo === null || this.query.billNo === "" || this.list.length === 0) {
}).then(() => { return;
let ids = []; }
this.list.forEach(item => { this.$confirm("是否确认删除此单据及所有关联单据?", "提示", {
ids.push(item.id); confirmButtonText: '确定',
}); cancelButtonText: '取消',
let params = { type: 'warning'
ids: ids }).then(() => {
}; let ids = [];
deleteByOrderId(params).then((res) => {
if (res.code === 20000) {
this.$message.success("删除成功");
this.list = [];
this.detailList = [];
}
}).catch((error) => {
this.$message.error("删除失败");
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
})
},
editAllOrderTime() {
if (this.query.billNo === null || this.query.billNo === "" || this.list.length === 0) {
return;
}
this.actDate = null;
this.auditTime = null;
this.editOrderVisible = true;
},
intentDetail(row) {
this.codeDetailVisible = true;
this.idQuery.id = row.id;
},
handleEdit(row) {
this.editOrderVisible = true;
let actDateSplit = row.actDate.split(" ");
this.actDate = actDateSplit[0];
this.actDate2 = actDateSplit[1];
let auditTimeSplit = row.auditTime.split(" ");
this.auditTime = auditTimeSplit[0];
this.auditTime2 = auditTimeSplit[1];
this.orderIds = [];
},
updateOrderInfo() {
if (this.actDate === null || this.actDate === '') {
this.$message.warning("创建时间不能为空");
return;
}
this.editOrderVisible = false;
this.list.forEach(item => { this.list.forEach(item => {
this.orderIds.push(item.id); ids.push(item.id);
}); });
let data = { let params = {
actDate: this.actDate, ids: ids
auditTime: this.auditTime,
orderIds: this.orderIds
}; };
updateOrderInfo(data).then((res) => { deleteByOrderId(params).then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
this.$message.success("修改成功"); this.$message.success("删除成功");
this.getList(); this.list = [];
this.detailList = [];
} }
}).catch((error) => { }).catch((error) => {
this.$message.error(error.message); this.$message.error("删除失败");
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
}); });
}, })
cancelEdit() { },
this.editOrderVisible = false; editAllOrderTime() {
if (this.query.billNo === null || this.query.billNo === "" || this.list.length === 0) {
return;
} }
this.actDate = null;
this.auditTime = null;
this.editOrderVisible = true;
}, },
components: { intentDetail(row) {
codeReplace this.codeDetailVisible = true;
this.idQuery.id = row.id;
}, },
filters: { handleEdit(row) {
statusFilterType(status) { this.editOrderVisible = true;
const statusMap = { let actDateSplit = row.actDate.split(" ");
0: "gray", this.actDate = actDateSplit[0];
1: "success" this.actDate2 = actDateSplit[1];
};
return statusMap[status]; let auditTimeSplit = row.auditTime.split(" ");
}, this.auditTime = auditTimeSplit[0];
statusFilterName(status) { this.auditTime2 = auditTimeSplit[1];
const statusMap = {
"1": "草稿", this.orderIds = [];
"2": "未配货", },
"3": "待校验", updateOrderInfo() {
"4": "已校验", if (this.actDate === null || this.actDate === '') {
"5": "已核对", this.$message.warning("创建时间不能为空");
}; return;
return statusMap[status];
},
typeFilterName(type) {
const typeMap = {
1: "预入库",
2: "普通采购",
};
return typeMap[type];
} }
this.editOrderVisible = false;
this.list.forEach(item => {
this.orderIds.push(item.id);
});
let data = {
actDate: this.actDate,
auditTime: this.auditTime,
orderIds: this.orderIds
};
updateOrderInfo(data).then((res) => {
if (res.code === 20000) {
this.$message.success("修改成功");
this.getList();
}
}).catch((error) => {
this.$message.error(error.message);
});
}, },
created() { cancelEdit() {
this.getBusType(); this.editOrderVisible = false;
this.getStorage();
} }
},
components: {
codeReplace
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "gray",
1: "success"
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
"1": "草稿",
"2": "未配货",
"3": "待校验",
"4": "已校验",
"5": "已核对",
};
return statusMap[status];
},
typeFilterName(type) {
const typeMap = {
1: "预入库",
2: "普通采购",
};
return typeMap[type];
}
},
created() {
this.getBusType();
this.getStorage();
} }
}
</script> </script>
<style scoped> <style scoped>
.el-dialog { .el-dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0 !important; margin: 0 !important;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.el-dialog .el-dialog__body { .el-dialog .el-dialog__body {
flex: 1; flex: 1;
overflow: auto; overflow: auto;
} }
.el-table /deep/ .highlight-row { .el-table /deep/ .highlight-row {
background: #cae3f9; background: #cae3f9;
} }
</style> </style>

@ -106,11 +106,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<!-- <el-table-column label="采购类型">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.type | typeFilterName }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" width="250"> <el-table-column label="操作" fixed="right" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button

@ -113,11 +113,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<!-- <el-table-column label="采购类别" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.type | typeFilterName }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button

@ -104,6 +104,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="200"> <el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button

@ -105,11 +105,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<!-- <el-table-column label="采购类型">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.type | typeFilterName }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" width="200"> <el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button

@ -117,6 +117,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="actDate" prop="actDate"

@ -116,6 +116,7 @@
</el-table-column> </el-table-column>
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="actDate" prop="actDate"

@ -104,6 +104,7 @@
<el-table-column label="当前分库" prop="subInvName" width="120"> <el-table-column label="当前分库" prop="subInvName" width="120">
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="actDate" show-overflow-tooltip> <el-table-column label="创建时间" prop="actDate" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<i class="el-icon-time"></i> <i class="el-icon-time"></i>

Loading…
Cancel
Save