1.修改新增盘点单页面

feature-order-fix
x_z 2 years ago
parent b03776ddfe
commit 74eb8d9ced

@ -24,3 +24,10 @@ export function getCountOrderDetailList(params) {
});
}
export function saveCountOrder(data) {
return axios({
url: "/invCount/order/saveCountOrder",
method: "post",
data: data
});
}

@ -23,3 +23,11 @@ export function deleteSpace(data) {
data: data
})
}
export function getSpaceCodeList(params) {
return axios({
url: "/spms/inv/space/getSpaceCodeList",
method: "get",
params: params
})
}

@ -828,8 +828,6 @@ export const asyncRouterMap = [
authRule: ["warehouse/onHand"]
}
},
{
path: "stockCode",
name: "库存明细",
@ -839,7 +837,6 @@ export const asyncRouterMap = [
authRule: ["warehouse/stockCode"]
}
},
]
},

@ -199,7 +199,6 @@ import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
import {isBlank} from "@/utils/strUtil";
import {getInvSpaceList, saveSpace, deleteSpace} from "@/api/inventory/invSpace";
import ThrInvProducts from "@/views/thrsys/ThrInvProducts";
export default {
data() {

@ -0,0 +1,438 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
<el-button
type="primary"
@click.native="saveOrder()"
:loading="loading"
>保存
</el-button
>
</el-button-group>
</el-row>
<el-card style="margin-top: -5px;">
<el-row :gutter="20" style="margin-top: 10px;">
<el-col :span="3">
<div class="ao-text">
<span>单据号</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="orderId">
<el-input v-model="formData.orderId" auto-complete="off" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>单据日期</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="billDate">
<!-- <el-input v-model="formData.billdate" auto-complete="off"></el-input>-->
<el-date-picker
v-model="formData.billDate"
type="datetime"
placeholder="选择日期"
style="width: 100%"
:clearable="false"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 0px">
<el-col :span="3">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息"
@change="locInChange"
:disabled="codeArray.length>0"
clearable>
<el-option
v-for="item in storageList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>当前分库</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item prop="invWarehouseCode">
<el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息"
:disabled="codeArray.length>0"
@change="subStorageChange"
clearable>
<el-option
v-for="item in subInvList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="3">
<div class="ao-text">
<span>当前货位</span>
</div>
</el-col>
<el-col :span="7">
<el-form-item class="query-form-item" prop="invSpaceCode"
>
<el-select v-model="formData.invSpaceCode" placeholder="当前货位信息"
:disabled="codeArray.length>0"
clearable>
<el-option
v-for="item in spaceList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<el-button-group style="display: flex">
<el-button
type="primary"
size="small"
@click.native.stop="selectProductFunction()"
style="margin: 0px 60px 10px auto; height: 35px"
:loading="loading"
>产品录入
</el-button
>
</el-button-group>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;"
max-height="300" height="300" ref="multipleTable">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column width="150"
label="产品通用名"
prop="productName"
show-overflow-tooltip
></el-table-column>
<el-table-column width="150"
label="规格型号"
prop="spec"
show-overflow-tooltip
></el-table-column>
<el-table-column width="150" label="批次号" prop="batchNo">
</el-table-column>
<el-table-column width="180" label="生产日期(yyMMdd)" prop="productDate">
</el-table-column>
<el-table-column width="180" label="失效日期(yyMMdd)" prop="expireDate" show-overflow-tooltip>
</el-table-column>
<el-table-column width="250" label="注册/备案凭证号" prop="zczbhhzbapzbh" show-overflow-tooltip>
</el-table-column>
<el-table-column width="150" abel="生产厂家" prop="ylqxzcrbarmc"
show-overflow-tooltip></el-table-column>
<el-table-column width="150" abel="库存数量" prop="invCount"
show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.stop="true"
@click.native="deleteCodeArray(scope.$index, scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-form>
<el-dialog
title="库存产品录入"
:visible.sync="selectInvProductVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="selectInvProductVisible"
:append-to-body='true'
>
<el-card>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.cpmctymc" placeholder="产品名称"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.batchNo" placeholder="批次号"></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getInvProducts"
>查询
</el-button
>
<el-button type="primary" icon="search" @click="combine"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="productList" style="width: 100%"
highlight-current-row="false"
ref="multipleTable">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品标识" prop="nameCode"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc"></el-table-column>
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="生产日期" prop="productionDate"></el-table-column>
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
<el-table-column label="入库数量" prop="inCount"></el-table-column>
<el-table-column label="出库数量" prop="outCount"></el-table-column>
<el-table-column label="结余数量" prop="reCount">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</el-card>
</el-dialog>
</div>
</template>
<script>
import store from "../../store";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {isBlank} from "@/utils/strUtil";
import {filterAllByUser} from "@/api/basic/invWarehouse";
import {getSpaceCodeList} from "@/api/inventory/invSpace";
import {filterProducts} from "@/api/inventory/InvProducts";
import {saveCountOrder} from "@/api/inventory/invCountOrder";
export default {
name: "closeDialog",
props: {
data: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
},
data() {
return {
formData: {
orderId: null,
billDate: null,
locStorageCode: null,
invWarehouseCode: null,
invSpaceCode: null
},
formRules: {
billDate: [
{required: true, message: "请选择单据日期", trigger: "blur"}
],
locStorageCode: [
{required: true, message: "请选择当前仓库", trigger: "blur"}
],
invWarehouseCode: [
{required: true, message: "请选择当前分库", trigger: "blur"}
],
invSpaceCode: [
{required: true, message: "请选择当前货位", trigger: "blur"}
]
},
codeArray: [],
total: 0,
loading: false,
index: null,
selectInvProductVisible: false,
storageList: [],
subInvList: [],
spaceList: [],
thisData: {},
filterQuery: {
invStorageCode: null,
invWarehouseCode: null,
nameCode: null,
cpmctymc: null,
batchNo: null,
page: 1,
limit: 10
},
productList: []
};
},
methods: {
saveOrder() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
saveCountOrder(this.formData).then((res) => {
if (res.code === 20000) {
this.$message.success("保存成功");
this.closeDialog();
} else {
this.$message.error(res.data.message);
}
})
}
})
},
//
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getInvProducts();
},
locInChange() {
//
let params = {pcode: this.formData.locStorageCode}
filterSubByInv(params).then((res) => {
this.subInvList = res.data || [];
});
this.formData.invWarehouseCode = null;
this.formData.invSpaceCode = null;
},
subStorageChange() {
//
let params = {
invStorageCode: this.formData.locStorageCode,
invWarehouseCode: this.formData.invWarehouseCode
};
getSpaceCodeList(params).then((res) => {
this.spaceList = res.data || [];
});
this.formData.invSpaceCode = null;
},
selectProductFunction() {
if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) {
this.$message.warning("请先选择当前仓库和分库");
return;
}
this.selectInvProductVisible = true;
this.onReset();
this.getInvProducts();
},
getInvProducts() {
this.filterQuery.invStorageCode = this.formData.locStorageCode;
this.filterQuery.invWarehouseCode = this.formData.invWarehouseCode;
filterProducts(this.filterQuery).then((res) => {
if (res.code === 20000) {
this.productList = res.data.list || [];
this.total = res.data.total || 0;
}
})
},
getStorage() {
filterAllByUser().then((res) => {
if (res.code === 20000) {
this.storageList = res.data || [];
}
})
},
onReset() {
this.filterQuery = {
invStorageCode: null,
invWarehouseCode: null,
nameCode: null,
cpmctymc: null,
batchNo: null,
page: 1,
limit: 10
};
this.getInvProducts();
},
combine() {
let selection = this.$refs.multipleTable.selection;
if (selection.length === 0) {
this.$message.warning("请选择产品");
return;
}
selection.forEach(product => {
let data = {
productName: product.cpmctymc,
spce: product.ggxh,
batchNo: product.batchNo,
produceDate: product.productionDate,
expireDate: product.expireDate,
zczbhhzbapzbh: null,
ylqxzcrbarmc: null,
invCount: product.inCount - product.outCount
};
this.codeArray.push(data);
})
this.selectInvProductVisible = false;
},
deleteCodeArray(index, row) {
for (let i = 0; i < this.codeArray.length; i++) {
if (this.codeArray[i] === row) {
this.codeArray.splice(i, 1);
return;
}
}
},
},
created() {
this.getStorage();
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>

@ -1,4 +1,3 @@
invCountOrderNew.vue
<template>
<div>
<el-card>

@ -99,6 +99,19 @@
layout="prev, pager, next"
:total="total"
></el-pagination>
<el-dialog
title="新增盘点单"
:visible.sync="addCountOrderVisible"
width="70%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addCountOrderVisible"
>
<addCountOrder
:closeDialog="closeAddDialog"
></addCountOrder>
</el-dialog>
</div>
</template>
@ -109,6 +122,7 @@ import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
import {isBlank} from "@/utils/strUtil";
import addCountOrder from "./addCountOrder";
export default {
data() {
@ -117,6 +131,7 @@ export default {
invWarehouseCode: null,
invStorageCode: null,
invSpaceCode: null,
status: 0,
page: 1,
limit: 20,
customerId: null
@ -134,6 +149,8 @@ export default {
1: "未审核",
2: "已审核"
},
addCountOrderVisible: false,
};
},
methods: {
@ -145,6 +162,7 @@ export default {
customerId: null,
invWarehouseCode: null,
invStorageCode: null,
status: 0,
page: 1,
limit: 20,
};
@ -163,15 +181,36 @@ export default {
getList() {
this.loading = true;
this.filterQuery.customerId = store.getters.customerId;
getCountOrderList(this.filterQuery).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.list = res.data.list || [];
this.total = res.data.total || 0;
} else {
this.list = [];
this.total = 0;
}
}).catch((error) => {
this.loading = false;
this.list = [];
this.total = 0;
})
},
deleteOrders(data) {
this.loading = true;
let query = {
let params = {
id: data,
}
deleteCountOrder(params).then((res) => {
if (res.code === 20000) {
this.$message.success("删除成功!");
this.getList();
} else {
this.$message.error(res.data.message);
}
})
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
@ -215,27 +254,16 @@ export default {
},
addCountOrder() {
this.addCountOrderVisible = true;
},
closeAddDialog() {
this.addCountOrderVisible = false;
this.getList();
},
},
filters: {
statusFilterType(status) {
const statusMap = {
false: "success",
true: "danger",
};
return statusMap[status];
}
,
}
,
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
}
,
components: {
addCountOrder
},
created() {
this.getStorage();
let query = this.$route.query;
@ -254,10 +282,8 @@ export default {
}
}).catch((error) => {
});
}
,
}
;
},
};
</script>
<style type="text/scss" lang="scss">

Loading…
Cancel
Save