123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <script>
- import test from "@/components/form-test/index.vue";
- import query from "@/components/query/index.vue";
- import * as API from "@/api/inbound-outbound/outbound/manualOutbound.js";
- import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
- import addManualOutbound from "./addManualOutbound.vue";
- export default {
- components: {
- test,
- query,
- addManualOutbound,
- },
- data() {
- return {
- warehouseSelectList: [],
- warehouseTypeList: [],
- outboundTypeList: [],
- btnForm: {
- otherButton: {
- list: [
- {
- name: "手动出库",
- methodsText: "add",
- type: "primary",
- add: () => {
- this.handleAdd();
- },
- },
- ],
- },
- },
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- warehouseId: "",
- type: "",
- code: "",
- createUser: "",
- startTime: "",
- endTime: "",
- },
- selectConfig: [
- {
- label: "仓库名称",
- prop: "warehouseId",
- data: [],
- },
- ],
- tableList: [],
- total: 0,
- loading: false,
- titleText: "手动出库",
- open: false,
- form: {
- warehouseId: "",
- remarks: "",
- type: "",
- changeProductList: [],
- },
- };
- },
- created() {
- const businessDictData = JSON.parse(
- window.localStorage.getItem("businessDict")
- );
- this.warehouseTypeList = businessDictData.find(
- (item) => item.code === "warehouseType"
- ).children;
- this.outboundTypeList = businessDictData.find(
- (item) => item.code === "outboundType"
- ).children;
- warehouseSelectList().then((res) => {
- this.warehouseSelectList = res.data.data;
- this.selectConfig[0].data = this.warehouseSelectList.map((item) => ({
- label: item.name,
- value: item.id,
- }));
- });
- this.getList();
- },
- methods: {
- getList() {
- this.loading = true;
- API.manualList(this.queryParams).then(
- (res) => {
- this.tableList = res.data.data.records;
- this.total = res.data.data.total;
- this.loading = false;
- },
- (err) => {
- console.log("manualList: " + err);
- this.loading = false;
- }
- );
- },
- handleQuery() {
- this.getList();
- },
- handleAdd() {
- this.form = {
- warehouseId: "",
- remarks: "",
- type: "",
- changeProductList: [],
- };
- this.open = true;
- },
- handleCancel() {
- this.open = false;
- },
- handleSubmit() {
- API.manualOutbound(this.form).then(
- () => {
- this.msgSuccess("添加成功");
- this.$refs.addManualOutbound.loading = false;
- this.open = false;
- this.getList();
- },
- (err) => {
- console.log("manualOutbound: " + err);
- this.$refs.addManualOutbound.loading = false;
- }
- );
- },
- showAddress(row) {
- return (
- <div>
- {row.countryName} , {row.provinceName} , {row.cityName}
- </div>
- );
- },
- },
- };
- </script>
- <template>
- <div class="box-card">
- <el-card class="header">
- <test :form-config="btnForm"></test>
- </el-card>
- <el-card class="body-main">
- <query
- :selectConfig="selectConfig"
- :req="queryParams"
- :isShowMore="true"
- @handleQuery="handleQuery"
- @handleMore="
- () => {
- queryDialog = true;
- }
- "
- ></query>
- <el-table :data="tableList" v-loading="loading">
- <el-table-column label="仓库名称" align="left" />
- <el-table-column
- label="物品编码"
- align="left"
- prop="code"
- width="150"
- />
- <el-table-column label="物品名称" align="left" prop="name" />
- <el-table-column label="规格" align="left" prop="spec" width="130" />
- <el-table-column label="单位" align="left" prop="unit" width="100" />
- <el-table-column
- label="出库数量"
- align="left"
- prop="changeQuantity"
- width="120"
- />
- <el-table-column
- label="操作人"
- align="left"
- prop="createUserName"
- width="100"
- />
- <el-table-column
- label="操作时间"
- align="left"
- prop="createTime"
- width="150"
- />
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </el-card>
- <el-dialog
- :title="titleText"
- :visible.sync="open"
- v-if="open"
- width="80%"
- top="60px"
- >
- <add-manual-outbound
- :form="form"
- :warehouseSelectList="warehouseSelectList"
- :warehouseTypeList="warehouseTypeList"
- :outboundTypeList="outboundTypeList"
- @submit="handleSubmit"
- @cancel="handleCancel"
- ref="addManualOutbound"
- ></add-manual-outbound>
- </el-dialog>
- </div>
- </template>
- <style lang="scss" scoped>
- .box-card {
- height: calc(100vh - 110px);
- overflow-y: auto;
- display: flex;
- flex-direction: column;
- .header {
- // height: 100px;
- margin-bottom: 10px;
- box-sizing: border-box;
- }
- .body-main {
- flex: 1;
- overflow-y: auto;
- }
- }
- </style>
|