123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436 |
- <template>
- <div class="stockWarning pagePadding">
- <div
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
- >
- <div style="width: 100%">
- <el-row style="padding: 20px 0 0 30px">
- <el-col :span="8">
- <CompanySearch
- style="dispaly: inline-block; padding-left: 10px"
- @searchCard="getCompany"
- :isSize="isSize"
- ></CompanySearch>
- </el-col>
- <el-col :span="8"
- ><StockSearch
- :isDisabled="isDesabled"
- :isSize="isSize"
- ></StockSearch
- ></el-col>
- </el-row>
- </div>
- <div class="stock-survey clear">
- <el-row v-for="item in stock_list" :key="item.id" style="float: left">
- <el-col :span="24" class="card">
- <el-card shadow="always">
- <i :class="item.icon" class="icon"></i>
- {{ item.num }}
- <countTo
- style="display: block"
- :startVal="startVal"
- :endVal="item.endVal"
- :duration="3000"
- ></countTo>
- <p style="margin-top: 5px">{{ item.label }}</p>
- </el-card>
- </el-col>
- </el-row>
- </div>
- <ex-table
- v-loading="false"
- :table="table"
- :data="tableData"
- :columns="columns"
- :page="pageInfo"
- :size="size"
- @row-click="handClick"
- @page-curr-change="handlePageChange"
- @page-size-change="handleSizeChange"
- @screen-reset="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- @screen-submit="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <template #table-header="{}">
- <div style="width: 100%; height: 30px; line-height: 30px">
- <i class="el-icon-s-unfold" style="height: 10px"></i>库存操作记录
- </div>
- </template>
- </ex-table>
- <add-edit
- :id="modelId"
- :sitem="sitem"
- :show-model="showModel"
- :is-detail="isDetail"
- @refresh="searchList"
- @cancel="showModel = false"
- />
- </div>
- <div v-else>
- <no-auth></no-auth>
- </div>
- </div>
- </template>
- <script>
- import mixinPage from "@/mixins/elPaginationHandle";
- import resToken from "@/mixins/resToken";
- import asyncRequest from "@/mock/service/stock/survey";
- import countTo from "vue-count-to";
- import addEdit from "./addEdit";
- import { mapGetters } from "vuex";
- export default {
- name: "survey",
- mixins: [mixinPage, resToken],
- components: {
- addEdit,
- countTo,
- },
- computed: {
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
- powers() {
- let tran =
- this.$store.getters.btnList.find(
- (item) => item.menu_route == "survey"
- ) || {};
- if (tran && tran.action && tran.action.length > 0) {
- return tran.action;
- } else {
- return [];
- }
- },
- },
- data() {
- return {
- isSize: true,
- isDesabled: "",
- options: [],
- startVal: 0,
- stock: [],
- stock_list: [
-
- {
- id: "1",
- icon: "el-icon-box",
- label: "当前库存",
- num: 0,
- endVal: 0,
- },
- {
- id: "2",
- icon: "el-icon-download",
- label: "待入库",
- endVal: 0,
- num: 0,
- },
- {
- id: "3",
- icon: "el-icon-upload2",
- label: "待出库",
- endVal: 0,
- num: 0,
- },
- {
- id: "4",
- icon: "el-icon-shopping-cart-full",
- label: "可用库存",
- endVal: 0,
- num: 0,
- },
- {
- id: "5",
- icon: "el-icon-truck",
- label: "在途库存",
- num: 0,
- endVal: 0,
- },
- ],
- arr1: [],
- loading: true,
- showModel: false,
- isDetail: false,
- modelId: 0,
- tableData: [],
- table: {
-
- stripe: true,
- border: true,
-
- },
-
- pageInfo: {
- size: 15,
- curr: 1,
- total: 0,
- },
- columns: [
-
- {
- prop: "id",
- label: "记录编号",
- },
- {
- prop: "author",
- label: "操作人",
- },
- {
- prop: "reviewer",
- label: "部门",
- },
- {
- prop: "type",
- label: "库存类型",
- },
- {
- prop: "number",
- label: "操作数量",
-
-
- },
- {
- prop: "typeo",
- label: "库存来源",
-
- },
- {
- prop: "addTime",
- label: "操作时间",
-
- },
- ],
- parmValue: {
-
-
-
-
-
-
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- };
- },
- mounted() {
- this.searchList();
-
-
- },
- methods: {
- wchange(e) {
- console.log(e);
- },
- restSearch() {
-
-
-
-
-
-
-
-
-
-
- },
- openModal(id, isDetail, sitem) {
-
- this.showModel = true;
- this.modelId = id;
- this.isDetail = isDetail;
- this.sitem = sitem;
- },
- async deleteById(id, status) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- getCompany(val) {
- console.log("获取仓库数据");
- console.log(val);
- this.isDesabled = val;
- console.log(this.isDesabled);
- this.stockList();
- },
- async stockList() {
-
-
- const res1 = await asyncRequest.statistics(this.parmValue);
-
- const { value1, value2, value3, value4, value5 } = res1.data;
- this.stock.push(value1, value2, value3, value4, value5);
-
-
-
- for (let i = 0; i <= this.stock_list.length - 1; i++) {
-
- this.stock_list[i].endVal = this.stock[i];
- }
-
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- async searchList() {
-
- this.loading = true;
-
- const res = await asyncRequest.log(this.parmValue);
-
- if (res && res.code === 0 && res.data) {
-
- this.tableData = res.data.list;
- this.pageInfo.total = Number(res.data.count);
-
-
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.tableData = [];
- this.pageInfo.total = 0;
- }
- this.loading = false;
- },
- async statusConfirm(id, status) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @import "~@/styles/index.scss";
- .card {
- width: 200px;
- height: 115px;
- flex: 1;
- }
- @media screen and (max-width: 1500px) {
- .card {
- width: 160px;
- }
- }
- @media screen and (max-width: 1350px) {
- .card {
- width: 130px;
- }
- }
- .stock-survey {
- width: 100%;
- display: flex;
- // position: relative;
- justify-content: space-around;
- overflow: hidden;
- padding: 20px 0 20px 10px;
- text-align: center;
- .icon {
- font-size: 40px;
- padding-bottom: 10px;
- }
- p {
- cursor: default;
- }
- }
- </style>
|