|
|
|
@ -61,6 +61,9 @@
|
|
|
|
|
<span>{{ getStorageName(scope.row.locStorageCode) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="创建时间"
|
|
|
|
|
prop="actDate"
|
|
|
|
@ -72,24 +75,6 @@
|
|
|
|
|
<span>{{ scope.row.actDate }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</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">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
@ -237,368 +222,368 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {filterOrderForDelete, orderDetail, deleteByOrderId, updateOrderInfo} from "../../api/inout/order";
|
|
|
|
|
import store from "../../store";
|
|
|
|
|
import {getBussinessType} from "../../api/basic/bussinessType";
|
|
|
|
|
import {filterAllByUser} from "../../api/basic/invWarehouse";
|
|
|
|
|
import codeReplace from "./codeReplace";
|
|
|
|
|
import {filterOrderForDelete, orderDetail, deleteByOrderId, updateOrderInfo} from "../../api/inout/order";
|
|
|
|
|
import store from "../../store";
|
|
|
|
|
import {getBussinessType} from "../../api/basic/bussinessType";
|
|
|
|
|
import {filterAllByUser} from "../../api/basic/invWarehouse";
|
|
|
|
|
import codeReplace from "./codeReplace";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "stockOrderDelete",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
query: {
|
|
|
|
|
billNo: "",
|
|
|
|
|
page: 1,
|
|
|
|
|
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 = [];
|
|
|
|
|
export default {
|
|
|
|
|
name: "stockOrderDelete",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
query: {
|
|
|
|
|
billNo: "",
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10
|
|
|
|
|
},
|
|
|
|
|
onSubmit() {
|
|
|
|
|
this.getList();
|
|
|
|
|
detailQuery: {
|
|
|
|
|
orderIdFk: "",
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
this.query.page = val;
|
|
|
|
|
this.getList();
|
|
|
|
|
busTypes: [],
|
|
|
|
|
list: [],
|
|
|
|
|
detailList: [],
|
|
|
|
|
currentCheckIndex: -1,
|
|
|
|
|
multipId: [],
|
|
|
|
|
formLabelWidth: '150px',
|
|
|
|
|
total: 0,
|
|
|
|
|
detailTotal: 0,
|
|
|
|
|
storageList: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
detailLoading: false,
|
|
|
|
|
idQuery: {
|
|
|
|
|
id: "",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
changeFun(row) {
|
|
|
|
|
let _this = this;
|
|
|
|
|
_this.multipId = []; //每次改动重置ID
|
|
|
|
|
row.forEach((item) => {
|
|
|
|
|
_this.multipId.push(item.id);
|
|
|
|
|
})
|
|
|
|
|
sourceMap: {
|
|
|
|
|
"1": "web端新增单据",
|
|
|
|
|
"2": "第三方系统",
|
|
|
|
|
"3": "扫码单据转换",
|
|
|
|
|
},
|
|
|
|
|
detailHandleCurrentChange(val) {
|
|
|
|
|
this.query.page = val;
|
|
|
|
|
this.getOrderDetailList();
|
|
|
|
|
fromTypeMap: {
|
|
|
|
|
"1": "UDIMS平台",
|
|
|
|
|
"2": "网页新增",
|
|
|
|
|
"3": "pda即时校验",
|
|
|
|
|
"4": "pda未校验",
|
|
|
|
|
"5": "pc端扫码精灵",
|
|
|
|
|
"6": "缺量补录单据",
|
|
|
|
|
"7": "UDI供应商平台",
|
|
|
|
|
"8": "平衡补录单据",
|
|
|
|
|
},
|
|
|
|
|
// 刷新表单
|
|
|
|
|
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(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = [];
|
|
|
|
|
this.total = 0;
|
|
|
|
|
this.detailList = [];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
erpCheckStatus: {
|
|
|
|
|
// error: "校验异常",
|
|
|
|
|
// null: "未校验",
|
|
|
|
|
// success: "正常",
|
|
|
|
|
1: "校验异常",
|
|
|
|
|
0: "未校验",
|
|
|
|
|
2: "校验成功",
|
|
|
|
|
},
|
|
|
|
|
getOrderDetailList(row) {
|
|
|
|
|
if (this.$isNotBlank(row)) {
|
|
|
|
|
this.detailQuery.orderId = row.id;
|
|
|
|
|
this.detailQuery.orderIdFk = row.id;
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
this.detailLoading = true;
|
|
|
|
|
orderDetail(this.detailQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.detailLoading = false;
|
|
|
|
|
this.detailList = response.data || [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
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(() => {
|
|
|
|
|
this.detailLoading = false;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.list = [];
|
|
|
|
|
this.total = 0;
|
|
|
|
|
this.detailList = [];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
tableRowClassName({row, rowIndex}) {
|
|
|
|
|
if (rowIndex === 0) {
|
|
|
|
|
return 'highlight-row';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getOrderDetailList(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) {
|
|
|
|
|
for (let i = 0; i < this.busTypes.length; i++) {
|
|
|
|
|
if (this.busTypes[i].action === action) {
|
|
|
|
|
return this.busTypes[i].name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getBusType() {
|
|
|
|
|
let query = {
|
|
|
|
|
enabled: true,
|
|
|
|
|
};
|
|
|
|
|
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 = {
|
|
|
|
|
enabled: true,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
deleteByOrderId(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '删除成功!'
|
|
|
|
|
});
|
|
|
|
|
this.getList();
|
|
|
|
|
this.detailList = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
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((error) => {
|
|
|
|
|
this.$message.error("删除失败");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteAllOrder() {
|
|
|
|
|
if (this.query.billNo === null || this.query.billNo === "" || this.list.length === 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.$confirm("是否确认删除此单据及所有关联单据?", "提示", {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
let ids = [];
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
ids.push(item.id);
|
|
|
|
|
});
|
|
|
|
|
let params = {
|
|
|
|
|
ids: 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;
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消删除'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deleteAllOrder() {
|
|
|
|
|
if (this.query.billNo === null || this.query.billNo === "" || this.list.length === 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.$confirm("是否确认删除此单据及所有关联单据?", "提示", {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
let ids = [];
|
|
|
|
|
this.list.forEach(item => {
|
|
|
|
|
this.orderIds.push(item.id);
|
|
|
|
|
ids.push(item.id);
|
|
|
|
|
});
|
|
|
|
|
let data = {
|
|
|
|
|
actDate: this.actDate,
|
|
|
|
|
auditTime: this.auditTime,
|
|
|
|
|
orderIds: this.orderIds
|
|
|
|
|
let params = {
|
|
|
|
|
ids: ids
|
|
|
|
|
};
|
|
|
|
|
updateOrderInfo(data).then((res) => {
|
|
|
|
|
deleteByOrderId(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("修改成功");
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
|
|
this.list = [];
|
|
|
|
|
this.detailList = [];
|
|
|
|
|
}
|
|
|
|
|
}).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: {
|
|
|
|
|
codeReplace
|
|
|
|
|
intentDetail(row) {
|
|
|
|
|
this.codeDetailVisible = true;
|
|
|
|
|
this.idQuery.id = row.id;
|
|
|
|
|
},
|
|
|
|
|
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];
|
|
|
|
|
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.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() {
|
|
|
|
|
this.getBusType();
|
|
|
|
|
this.getStorage();
|
|
|
|
|
cancelEdit() {
|
|
|
|
|
this.editOrderVisible = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
.el-dialog {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
margin: 0 !important;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
}
|
|
|
|
|
.el-dialog {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
margin: 0 !important;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-dialog .el-dialog__body {
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
}
|
|
|
|
|
.el-dialog .el-dialog__body {
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.el-table /deep/ .highlight-row {
|
|
|
|
|
background: #cae3f9;
|
|
|
|
|
}
|
|
|
|
|
.el-table /deep/ .highlight-row {
|
|
|
|
|
background: #cae3f9;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|