123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <script>
- import test from "@/components/form-test/index.vue";
- import query from "@/components/query/index.vue";
- import * as API from "@/api/inbound-outbound/transfer.js";
- import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
- import addInspection from "./addInspection.vue";
- export default {
- components: {
- test,
- query,
- addInspection,
- },
- data() {
- return {
- warehouseSelectList: [],
- warehouseTypeList: [],
- btnForm: {
- otherButton: {
- list: [
- {
- name: "发起调仓",
- methodsText: "send",
- type: "primary",
- send: () => {
- this.handleSend();
- },
- },
- ],
- },
- },
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- outWarehouseId: "",
- inWarehouseId: "",
- inStatus: "",
- },
- selectConfig: [
- {
- label: "异常来源",
- prop: "outWarehouseId",
- data: [],
- },
- {
- label: "处理状态",
- prop: "outWarehouseId",
- data: [],
- },
- ],
- tableList: [],
- total: 0,
- loading: false,
- titleText: "异常跟进",
- open: false,
- form: {
- outWarehouseId: "",
- inWarehouseId: "",
- remark: "",
- changeProductList: [],
- },
- };
- },
- created() {
- const businessDictData = JSON.parse(
- window.localStorage.getItem("businessDict")
- );
- this.warehouseTypeList = businessDictData.find(
- (item) => item.code === "warehouseType"
- ).children;
- warehouseSelectList().then((res) => {
- this.warehouseSelectList = res.data.data;
- this.selectConfig[0].data = this.warehouseSelectList.map((item) => ({
- label: item.name,
- value: item.id,
- }));
- this.selectConfig[1].data = this.warehouseSelectList.map((item) => ({
- label: item.name,
- value: item.id,
- }));
- });
- this.getList();
- },
- methods: {
- getList() {
- this.loading = true;
- API.transferList(this.queryParams).then(
- (res) => {
- this.tableList = res.data.data.records;
- this.total = res.data.data.total;
- this.loading = false;
- },
- (err) => {
- console.log("transferList: " + err);
- this.loading = false;
- }
- );
- },
- handleQuery() {
- this.getList();
- },
- handleSend() {
- this.form = {
- outWarehouseId: "",
- inWarehouseId: "",
- remark: "",
- changeProductList: [],
- };
- this.open = true;
- },
- handleCancel() {
- this.form = {
- outWarehouseId: "",
- inWarehouseId: "",
- remark: "",
- changeProductList: [],
- };
- this.open = false;
- },
- handleSubmit() {
- API.addInspection(this.form).then(
- () => {
- this.msgSuccess(this.$t("addSuccess"));
- this.$refs.addInspection.loading = false;
- this.open = false;
- this.getList();
- },
- (err) => {
- console.log("addInspection: " + err);
- this.$refs.addInspection.loading = false;
- }
- );
- },
- handleReceive(row) {
- this.open = true;
- // this.$confirm("是否确认接收 ?", {
- // confirmButtonText: this.$t("submitText"),
- // cancelButtonText: this.$t("cancelText"),
- // type: "warning",
- // }).then(() => {
- // API.receive({ id: row.id, inQuantity: row.outQuantity }).then(() => {
- // this.msgSuccess("接收成功");
- // this.getList();
- // });
- // });
- },
- showAddress(row) {
- return (
- <div>
- {row.countryName} , {row.provinceName} , {row.cityName}
- </div>
- );
- },
- },
- };
- </script>
- <template>
- <div class="box-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"
- prop="code"
- width="120"
- />
- <el-table-column label="异常说明" align="left" prop="name" />
- <el-table-column
- label="处理状态"
- align="left"
- prop="specs"
- width="100"
- />
- <el-table-column
- label="最近操作人"
- align="left"
- prop="outQuantity"
- width="120"
- />
- <el-table-column
- label="最近操作时间"
- align="left"
- prop="outUserName"
- width="160"
- />
- <el-table-column label="操作" align="center" width="120">
- <template slot-scope="scope">
- <el-button type="text" @click="handleReceive(scope.row)"
- >跟进
- </el-button>
- </template>
- </el-table-column>
- </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="30%"
- top="60px"
- >
- <add-inspection
- :form="form"
- @submit="handleSubmit"
- @cancel="handleCancel"
- ref="addInspection"
- ></add-inspection>
- </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;
- }
- }
- </style>
|