1.整理页面,保存代码

feature-order-fix
x_z 2 years ago
parent a05cbdb219
commit b03776ddfe

@ -0,0 +1,9 @@
import axios from "../../utils/axios";
export function getCountCodesList(params) {
return axios({
url: "/invCount/codes/filter",
method: "get",
params: params
});
}

@ -1,2 +1,26 @@
import axios from "../../utils/axios";
export function getCountOrderList(params) {
return axios({
url: "/invCount/order/filter",
method: "get",
params: params
});
}
export function deleteCountOrder(data) {
return axios({
url: "/invCount/order/delete",
method: "post",
data: data
});
}
export function getCountOrderDetailList(params) {
return axios({
url: "/invCount/order/detail/filter",
method: "get",
params: params
});
}

@ -1,441 +1,239 @@
invCountOrderNew.vue<template>
<div>
<el-card>
<el-form :inline="true" :model="filterQuery" size="mini">
<el-row style="width: 100%">
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.productsName" placeholder="产品名称" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.batchNo" placeholder="批次号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select
v-model="filterQuery.supId"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请输入供应商名称"
:remote-method="findMethod"
size="mini"
:loading="loading"
@change="corpChange"
>
<el-option
v-for="item in fromOptions"
:key="item.name"
:label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-row>
<el-row style="width: 100%">
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invStorageCode" placeholder="请选择当前仓库" clearable="true"
@change="invChange"
size="mini">
<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-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
:disabled="invWarehouseDisabled"
size="mini">
<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-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180">
</el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="仓库" prop="invStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="分库" prop="invSubStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="intentDetail(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
title="库存详情"
:visible.sync="codeDetailVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="codeDetailVisible"
>
<codeDetail
:idQuery="idQuery"
v-on:closeDetailDialog="closeDetailDialog"
></codeDetail>
</el-dialog>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</div>
invCountOrderNew.vue
<template>
<div>
<el-card>
<el-form :inline="true" :model="filterQuery" size="mini">
<el-row style="width: 100%">
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invStorageCode" placeholder="请选择当前仓库" clearable="true"
@change="invChange"
size="mini">
<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-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
:disabled="invWarehouseDisabled"
size="mini">
<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-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180">
</el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="仓库" prop="invStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="分库" prop="invSubStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="intentDetail(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</div>
</template>
<script>
import {
filterProducts,
deleteProducts,
} from "../../api/inventory/InvProducts";
import draggable from "vuedraggable";
import codeDetail from "./InvProductsDetail";
import store from "../../store";
import {getBussinessType} from "../../api/basic/bussinessType";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
import {isBlank} from "@/utils/strUtil";
export default {
data() {
return {
filterQuery: {
invWarehouseCode: null,
invStorageCode: null,
productsName: null,
nameCode: null,
relIdFk: null,
batchNo: null,
page: 1,
limit: 20,
customerId: null,
supId: null,
unitFk: null,
},
detailQuery: {
code: null,
productIdFk: null,
page: 1,
limit: 20,
},
list: [],
storageList: [],
subInvList: [],
codeDetailVisible: false,
total: 0,
loading: true,
index: null,
dialogTableVisible: false,
invWarehouseDisabled: true,
formLoading: false,
dialogVisible: false,
deleteLoading: false,
busTypes: [],
idQuery: null,
showSup: false,
fromOptions: [],
};
},
components: {
draggable,
codeDetail,
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
productsName: null,
nameCode: null,
relIdFk: null,
batchNo: null,
customerId: null,
unitFk: null,
supId: null,
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
};
this.invChange();
this.getList();
},
onSubmit() {
this.loading = true;
this.filterQuery.page = 1;
this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
handleUnitClick(row) {
this.curIndex = row.id;
this.dialogTableVisible = true;
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
},
closeDialog() {
this.getList();
},
getList() {
this.loading = true;
this.filterQuery.customerId = store.getters.customerId;
filterProducts(this.filterQuery)
.then((response) => {
this.showSup = response.data.showSup;
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
data() {
return {
filterQuery: {
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
customerId: null,
},
list: [],
storageList: [],
subInvList: [],
codeDetailVisible: false,
total: 0,
loading: true,
invWarehouseDisabled: true,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
customerId: null,
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
};
this.invChange();
this.getList();
},
onSubmit() {
this.loading = true;
this.filterQuery.page = 1;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
getList() {
this.loading = true;
this.filterQuery.customerId = store.getters.customerId;
},
deleteOrders(data) {
this.loading = true;
let query = {
id: data,
}
},
deleteOrders(data) {
this.loading = true;
let query = {
id: data,
}
deleteProducts(query)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteOrders(rowId);
})
.catch(() => {
});
},
getStorage() {
this.storageList = [];
filterUplLocInv()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = {
pcode: this.filterQuery.invStorageCode
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
} else {
this.$message.error(response.message);
this.invWarehouseDisabled = true;
}
})
.catch(() => {
});
},
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteOrders(rowId);
})
.catch(() => {
});
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
key: query,
customerName: query,
page: 1,
limit: 20
};
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.page.list || [];
})
.catch(() => {
this.loading = false;
});
},
getStorage() {
this.storageList = [];
filterUplLocInv()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = {
pcode: this.filterQuery.invStorageCode
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
} else {
this.invWarehouseDisabled = true;
}
},
intentDetail(row) {
this.idQuery = row;
this.idQuery.customerId = null;
this.codeDetailVisible = true;
},
corpChange(value) {
if (isBlank(value)) {
created() {
this.getStorage();
this.findMethod();
}
}
,
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
},
},
filters: {
statusFilterType(status) {
const statusMap = {
false: "success",
true: "danger",
};
return statusMap[status];
let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit);
//
//
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invStorageCode = res.data.locInvCode;
this.invChange();
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
}
this.getList();
}
}).catch((error) => {
});
}
,
}
,
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
}
,
created() {
this.getStorage();
this.findMethod();
let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit);
//
//
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invStorageCode = res.data.locInvCode;
this.invChange();
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
}
this.getList();
}
}).catch((error) => {
});
}
,
}
;
</script>

@ -1,176 +1,109 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="filterQuery" size="mini">
<el-row style="width: 100%">
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.productsName" placeholder="产品名称" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.batchNo" placeholder="批次号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select
v-model="filterQuery.supId"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请输入供应商名称"
:remote-method="findMethod"
size="mini"
:loading="loading"
@change="corpChange"
>
<el-option
v-for="item in fromOptions"
:key="item.name"
:label="item.name"
:value="item.erpId"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-row>
<el-row style="width: 100%">
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invStorageCode" placeholder="请选择当前仓库" clearable="true"
@change="invChange"
size="mini">
<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-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
:disabled="invWarehouseDisabled"
size="mini">
<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-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180">
</el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="仓库" prop="invStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="分库" prop="invSubStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="intentDetail(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
title="库存详情"
:visible.sync="codeDetailVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="codeDetailVisible"
>
<codeDetail
:idQuery="idQuery"
v-on:closeDetailDialog="closeDetailDialog"
></codeDetail>
</el-dialog>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</div>
<div>
<el-card>
<el-form :inline="true" :model="filterQuery" size="mini">
<el-row style="width: 100%">
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invStorageCode" placeholder="请选择当前仓库" clearable="true"
@change="invChange"
size="mini">
<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-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
:disabled="invWarehouseDisabled"
size="mini">
<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-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询
</el-button
>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180">
</el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip>
</el-table-column>
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }}
</template>
</el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column>
<el-table-column label="仓库" prop="invStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="分库" prop="invSubStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="intentDetail(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
></el-pagination>
</div>
</template>
<script>
import {
filterProducts,
deleteProducts,
} from "../../api/inventory/InvProducts";
import draggable from "vuedraggable";
import codeDetail from "./InvProductsDetail";
import store from "../../store";
import {getBussinessType} from "../../api/basic/bussinessType";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
@ -178,266 +111,128 @@ import {isBlank} from "@/utils/strUtil";
export default {
data() {
return {
filterQuery: {
invWarehouseCode: null,
invStorageCode: null,
productsName: null,
nameCode: null,
relIdFk: null,
batchNo: null,
page: 1,
limit: 20,
customerId: null,
supId: null,
unitFk: null,
},
detailQuery: {
code: null,
productIdFk: null,
page: 1,
limit: 20,
},
list: [],
storageList: [],
subInvList: [],
codeDetailVisible: false,
total: 0,
loading: true,
index: null,
dialogTableVisible: false,
invWarehouseDisabled: true,
formLoading: false,
dialogVisible: false,
deleteLoading: false,
busTypes: [],
idQuery: null,
showSup: false,
fromOptions: [],
};
},
components: {
draggable,
codeDetail,
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
productsName: null,
nameCode: null,
relIdFk: null,
batchNo: null,
customerId: null,
unitFk: null,
supId: null,
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
};
this.invChange();
this.getList();
},
onSubmit() {
this.loading = true;
this.filterQuery.page = 1;
this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
handleUnitClick(row) {
this.curIndex = row.id;
this.dialogTableVisible = true;
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
},
closeDialog() {
this.getList();
},
getList() {
this.loading = true;
this.filterQuery.customerId = store.getters.customerId;
filterProducts(this.filterQuery)
.then((response) => {
this.showSup = response.data.showSup;
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
data() {
return {
filterQuery: {
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
customerId: null,
},
list: [],
storageList: [],
subInvList: [],
codeDetailVisible: false,
total: 0,
loading: true,
invWarehouseDisabled: true,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
customerId: null,
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
};
this.invChange();
this.getList();
},
onSubmit() {
this.loading = true;
this.filterQuery.page = 1;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
getList() {
this.loading = true;
this.filterQuery.customerId = store.getters.customerId;
},
deleteOrders(data) {
this.loading = true;
let query = {
id: data,
}
},
deleteOrders(data) {
this.loading = true;
let query = {
id: data,
}
deleteProducts(query)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteOrders(rowId);
})
.catch(() => {
});
},
getStorage() {
this.storageList = [];
filterUplLocInv()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = {
pcode: this.filterQuery.invStorageCode
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
} else {
this.$message.error(response.message);
this.invWarehouseDisabled = true;
}
})
.catch(() => {
});
},
deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteOrders(rowId);
})
.catch(() => {
});
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
key: query,
customerName: query,
page: 1,
limit: 20
};
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.page.list || [];
})
.catch(() => {
this.loading = false;
});
},
getStorage() {
this.storageList = [];
filterUplLocInv()
.then((response) => {
this.storageList = response.data || [];
})
.catch(() => {
});
},
},
invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = {
pcode: this.filterQuery.invStorageCode
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
})
.catch(() => {
});
} else {
this.invWarehouseDisabled = true;
}
},
intentDetail(row) {
this.idQuery = row;
this.idQuery.customerId = null;
this.codeDetailVisible = true;
},
corpChange(value) {
if (isBlank(value)) {
created() {
this.getStorage();
this.findMethod();
}
}
,
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit);
//
//
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invStorageCode = res.data.locInvCode;
this.invChange();
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
}
this.getList();
}
}).catch((error) => {
});
},
},
filters: {
statusFilterType(status) {
const statusMap = {
false: "success",
true: "danger",
};
return statusMap[status];
}
,
}
,
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
}
,
created() {
this.getStorage();
this.findMethod();
let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit);
//
//
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invStorageCode = res.data.locInvCode;
this.invChange();
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
}
this.getList();
}
}).catch((error) => {
});
}
,
}
;
};
</script>
<style type="text/scss" lang="scss">

@ -104,6 +104,7 @@
<script>
import store from "../../store";
import {getCountOrderList, deleteCountOrder} from "@/api/inventory/invCountOrder";
import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";

Loading…
Cancel
Save