预验收删除,耗材字典根据供应商查询

busUser
anthonywj 2 years ago
parent cfa2329d1e
commit 77b22ebb0e

File diff suppressed because it is too large Load Diff

@ -1,142 +1,142 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="filterQuery" size="mini"> <el-form :inline="true" :model="filterQuery" size="mini">
<el-row style="width: 100%"> <el-row style="width: 100%">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI"></el-input> <el-input v-model="filterQuery.nameCode" placeholder="产品标识DI"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.productsName" placeholder="产品名称"></el-input> <el-input v-model="filterQuery.productsName" placeholder="产品名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.batchNo" placeholder="批次号"></el-input> <el-input v-model="filterQuery.batchNo" placeholder="批次号"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select <el-select
v-model="filterQuery.supId" v-model="filterQuery.supId"
filterable filterable
remote remote
clearable="true" clearable="true"
reserve-keyword reserve-keyword
placeholder="请输入供应商名称" placeholder="请输入供应商名称"
:remote-method="findMethod" :remote-method="findMethod"
size="mini" size="mini"
:loading="loading" :loading="loading"
> >
<el-option <el-option
v-for="item in fromOptions" v-for="item in fromOptions"
:key="item.companyName" :key="item.companyName"
:label="item.companyName" :label="item.companyName"
:value="item.customerId" :value="item.customerId"
> >
<span style="float: left">{{ item.companyName }}</span> <span style="float: left">{{ item.companyName }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row style="width: 100%"> <el-row style="width: 100%">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.ggxh" placeholder="规格型号"></el-input> <el-input v-model="filterQuery.ggxh" placeholder="规格型号"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号"></el-input> <el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家"></el-input> <el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.orderIdFk" placeholder="单据号"></el-input> <el-input v-model="filterQuery.orderIdFk" placeholder="单据号"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="onReset" @click="onReset"
></el-button> ></el-button>
<el-button type="primary" icon="search" @click="onSubmit" <el-button type="primary" icon="search" @click="onSubmit"
>查询 >查询
</el-button </el-button
> >
<el-button type="primary" icon="search" @click="clearAll" <el-button type="primary" icon="search" @click="clearAll"
>清空库存 >清空库存
</el-button </el-button
> >
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<el-table v-loading="loading" :data="list" style="width: 100%"> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column> <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="nameCode" width="120"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180"> <el-table-column label="产品名称" prop="cpmctymc" width="180">
</el-table-column> </el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="180"></el-table-column> <el-table-column label="规格型号" prop="ggxh" width="180"></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="120"></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="productionDate" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" 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="inCount" width="120"></el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip <el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column> width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip <el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column> width="120"></el-table-column>
<!-- <el-table-column label="仓库" prop="invStorageName" v-if="showSup"--> <!-- <el-table-column label="仓库" prop="invStorageName" v-if="showSup"-->
<!-- show-overflow-tooltip width="120"></el-table-column>--> <!-- show-overflow-tooltip width="120"></el-table-column>-->
<!-- <el-table-column label="操作" width="120" fixed="right">--> <!-- <el-table-column label="操作" width="120" fixed="right">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="text"--> <!-- type="text"-->
<!-- size="small"--> <!-- size="small"-->
<!-- @click.native.stop="intentDetail(scope.row)"--> <!-- @click.native.stop="intentDetail(scope.row)"-->
<!-- >详情--> <!-- >详情-->
<!-- </el-button--> <!-- </el-button-->
<!-- >--> <!-- >-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="text"--> <!-- type="text"-->
<!-- size="small"--> <!-- size="small"-->
<!-- @click.native.stop="deleteDialog(scope.row.id)"--> <!-- @click.native.stop="deleteDialog(scope.row.id)"-->
<!-- >删除--> <!-- >删除-->
<!-- </el-button--> <!-- </el-button-->
<!-- >--> <!-- >-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
</el-table> </el-table>
</el-card> </el-card>
<el-dialog <el-dialog
title="库存详情" title="库存详情"
:visible.sync="codeDetailVisible" :visible.sync="codeDetailVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
width="85%" width="85%"
v-if="codeDetailVisible" v-if="codeDetailVisible"
> >
<codeDetail <codeDetail
:idQuery="idQuery" :idQuery="idQuery"
v-on:closeDetailDialog="closeDetailDialog" v-on:closeDetailDialog="closeDetailDialog"
></codeDetail> ></codeDetail>
</el-dialog> </el-dialog>
<el-pagination <el-pagination
:page-size="filterQuery.limit" :page-size="filterQuery.limit"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:total="total" :total="total"
:current-page="filterQuery.page" :current-page="filterQuery.page"
></el-pagination> ></el-pagination>
</div> </div>
</template> </template>
<script> <script>
import { import {
filterProducts, filterProducts,
deleteProducts, clearAllProducts deleteProducts, clearAllProducts
} from "../../api/inventory/InvPreInProducts"; } from "../../api/inventory/InvPreInProducts";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import codeDetail from "./InvPreInProductsDetail"; import codeDetail from "./InvPreInProductsDetail";
@ -146,240 +146,240 @@ import {filterCustomers} from "@/api/auth/customer";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
cpmctymc: null, cpmctymc: null,
nameCode: null, nameCode: null,
relIdFk: null, relIdFk: null,
batchNo: null, batchNo: null,
page: 1, page: 1,
limit: 20, limit: 20,
customerId: null, customerId: null,
unitFk: null, unitFk: null,
}, },
detailQuery: { detailQuery: {
code: null, code: null,
productIdFk: null, productIdFk: null,
page: 1, page: 1,
limit: 20, limit: 20,
}, },
list: [], list: [],
fromOptions: [], fromOptions: [],
codeDetailVisible: false, codeDetailVisible: false,
total: 0, total: 0,
loading: true, loading: true,
index: null, index: null,
dialogTableVisible: false, dialogTableVisible: false,
formLoading: false, formLoading: false,
dialogVisible: false, dialogVisible: false,
deleteLoading: false, deleteLoading: false,
busTypes: [], busTypes: [],
idQuery: null, idQuery: null,
showSup: false, showSup: false,
}; };
},
components: {
draggable,
codeDetail,
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
cpmctymc: null,
nameCode: null,
relIdFk: null,
batchNo: null,
customerId: null,
page: 1, unitFk: null,
limit: 20,
};
this.getList();
}, },
components: { onSubmit() {
draggable, this.loading = true;
codeDetail, 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;
}, },
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
cpmctymc: null,
nameCode: null,
relIdFk: null,
batchNo: null,
customerId: null,
page: 1, unitFk: null,
limit: 20,
};
this.getList();
},
onSubmit() {
this.loading = true;
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() { closeDialog() {
this.getList(); this.getList();
}, },
getList() { getList() {
this.loading = true; this.loading = true;
this.filterQuery.customerId = store.getters.customerId; this.filterQuery.customerId = store.getters.customerId;
filterProducts(this.filterQuery) filterProducts(this.filterQuery)
.then((response) => { .then((response) => {
console.log(response) console.log(response)
this.loading = false; this.loading = false;
this.showSup = response.data.showSup; this.showSup = response.data.showSup;
this.list = response.data.list || []; this.list = response.data.list || [];
this.total = response.data.total || 0; this.total = response.data.total || 0;
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
this.list = []; this.list = [];
this.total = 0; this.total = 0;
}); });
}, },
deleteOrders(data) { deleteOrders(data) {
this.loading = true; this.loading = true;
let query = { let query = {
id: data, id: data,
}
deleteProducts(query)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
} }
deleteProducts(query)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
}) })
.catch(() => { .catch(() => {
}); });
}, },
deleteDialog(rowId) { deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", { this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.deleteOrders(rowId); this.deleteOrders(rowId);
}) })
.catch(() => { .catch(() => {
}); });
}, },
clearAll() { clearAll() {
this.$confirm("此操作将永久清空所有预验收库存信息, 是否继续?", "提示", { this.$confirm("此操作将永久清空所有预验收库存信息, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
let query = {id: 1}; let query = {id: 1};
clearAllProducts(query) clearAllProducts(query)
.then((response) => { .then((response) => {
if (response.code == 20000) { if (response.code == 20000) {
this.getList(); this.getList();
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!", message: "删除成功!",
}); });
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
}) })
}) })
.catch(() => { .catch(() => {
}); });
}, },
findMethod(query) { findMethod(query) {
this.fromOptions = []; this.fromOptions = [];
let cQuery = { let cQuery = {
key: query, key: query,
customerName: query, customerName: query,
}; };
// getBasicUnitMaintains(cQuery) // getBasicUnitMaintains(cQuery)
// .then((response) => { // .then((response) => {
// this.loading = false; // this.loading = false;
// this.fromOptions = response.data.page.list || []; // this.fromOptions = response.data.page.list || [];
// }) // })
// .catch(() => { // .catch(() => {
// this.loading = false; // this.loading = false;
// }); // });
filterCustomers(cQuery) filterCustomers(cQuery)
.then((response) => { .then((response) => {
this.fromOptions = response.data.list || []; this.fromOptions = response.data.list || [];
}) })
.catch(() => { .catch(() => {
this.fromOptions = []; this.fromOptions = [];
}); });
}, },
intentDetail(row) { intentDetail(row) {
this.idQuery = row; this.idQuery = row;
// this.idQuery.supId = null; // this.idQuery.supId = null;
this.idQuery.customerId = null; this.idQuery.customerId = null;
this.codeDetailVisible = true; this.codeDetailVisible = true;
},
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: { getBusType() {
statusFilterType(status) { let query = {
const statusMap = { enabled: true,
false: "success", };
true: "danger", getBussinessType(query)
}; .then((response) => {
return statusMap[status]; this.busTypes = response.data.list || [];
}, this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
}, },
mounted() { getActionName(action) {
document.body.ondrop = function (event) { for (let i = 0; i < this.busTypes.length; i++) {
event.preventDefault(); if (this.busTypes[i].action === action) {
event.stopPropagation(); return this.busTypes[i].name;
}; }
}
}, },
created() { },
this.findMethod(); filters: {
this.getBusType(); statusFilterType(status) {
let query = this.$route.query; const statusMap = {
this.filterQuery = Object.assign(this.filterQuery, query); false: "success",
this.filterQuery.limit = parseInt(this.filterQuery.limit); true: "danger",
// };
this.getList(); return statusMap[status];
}, },
},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
this.findMethod();
this.getBusType();
let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit);
//
this.getList();
},
}; };
</script> </script>

Loading…
Cancel
Save