123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <template>
- <div class="app-container">
- <!-- 筛选条件 -->
- <div>
- <el-form
- ref="screenForm"
- :model="screenForm"
- label-width="70px"
- size="small"
- label-position="left"
- >
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="存货编码" prop="materialNumber">
- <el-input
- placeholder="请输入存货编码"
- v-model="screenForm.materialNumber"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="存货名称" prop="materialName">
- <el-input
- placeholder="请输入存货名称"
- v-model="screenForm.materialName"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="生效日期" prop="startDate">
- <el-date-picker
- v-model="screenForm.startDate"
- type="datetime"
- placeholder="请输入生效日期"
- value-format="yyyy-MM-dd HH:mm:ss"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="失效日期" prop="endDate">
- <el-date-picker
- v-model="screenForm.endDate"
- type="datetime"
- placeholder="请输入生效日期"
- value-format="yyyy-MM-dd HH:mm:ss "
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="销售类型" prop="saleTypeId">
- <el-input
- placeholder="请输入销售类型"
- v-model="screenForm.saleTypeId"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="产品品类" prop="categoryId">
- <el-select
- placeholder="请选择产品品类"
- v-model="screenForm.categoryId"
- >
- <el-option
- v-for="item in dictList"
- :label="item.dictValue"
- :value="item.sysDictId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="规格型号" prop="specification">
- <el-input
- placeholder="请输入规格型号"
- v-model="screenForm.specification"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="24" :lg="24" class="tr">
- <el-form-item label="">
- <el-button size="small" @click="resetScreenForm">清空</el-button>
- <el-button size="small" type="primary" @click="submitScreenForm"
- >搜索</el-button
- >
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <!-- 按钮 -->
- <div class="btn-group clearfix">
- <div class="fr">
- <el-button type="primary" size="small">导出</el-button>
- <!-- <el-button type="primary" size="small">打印</el-button> -->
- </div>
- </div>
- <div class="mymain-container">
- <!-- 列表 -->
- <div class="table">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- stripe
- >
- <el-table-column type="selection" align="center"></el-table-column>
- <el-table-column
- align="center"
- label="产品品类"
- prop="mainName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="存货编码"
- prop="materialNumber"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="存货名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="销售类型"
- prop="saleTypeName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单位"
- prop="unit"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="数量下限"
- prop="qty"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="返利类型(钱包)"
- prop="wallets"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <template v-for="(item, index) in scope.row.wallets">
- <template v-if="item.type === 'REBATE'">
- <el-tag
- type="success"
- style="margin: 0 10px"
- size="small"
- :key="index"
- >
- {{ item.walletName }}
- </el-tag>
- </template>
- </template>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="现金钱包"
- prop="modifyPriceDepartment"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <template v-for="(item, index) in scope.row.wallets">
- <template v-if="item.type === 'COMMONLY'">
- <el-tag
- type="success"
- style="margin: 0 10px"
- size="small"
- :key="index"
- >
- {{ item.walletName }}
- </el-tag>
- </template>
- </template>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="生效日期"
- prop="startDate"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="失效日期"
- prop="endDate"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="是否促销价"
- prop="isPromote"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-tag type="success" v-if="scope.row.isPromote">是</el-tag>
- <el-tag type="danger" v-else>否</el-tag>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="是否促作废"
- prop="isRevoke"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-tag type="success" v-if="scope.row.isRevoke">是</el-tag>
- <el-tag type="danger" v-else>否</el-tag>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="批发价1"
- prop="batchPrice"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- fixed="right"
- width="150"
- label="操作"
- align="center"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- @click="handleRevoke(scope.row.id)"
- >作废</el-button
- >
- <el-button type="text" size="small" @click="">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="10"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Mixin from "@/mixin/index";
- import {
- getProductPriceList,
- handlePriceRevoke,
- } from "@/api/basic_data/material";
- import { getDictList } from "@/api/common";
- import { downloadFiles, parseTime } from "@/utils/util";
- export default {
- mixins: [Mixin],
- data() {
- return {
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表总数
- dataList: [],
- screenForm: {
- categoryId: "",
- endDate: "",
- materialName: "",
- materialNumber: "",
- saleTypeId: "",
- specification: "",
- startDate: "",
- },
- dictList: {},
- };
- },
- mounted() {
- getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
- this.dictList = res.data;
- });
- },
- methods: {
- addFn() {
- this.showDialogForm = true;
- },
- getList() {
- this.listLoading = true;
- let params = {
- pageNum: this.currentPage,
- pageSize: this.pageSize,
- categoryId: this.screenForm.categoryId,
- endDate: this.screenForm.endDate,
- materialName: this.screenForm.materialName,
- materialNumber: this.screenForm.materialNumber,
- saleTypeId: this.screenForm.saleTypeId,
- specification: this.screenForm.specification,
- startDate: this.screenForm.startDate,
- };
- getProductPriceList(params).then((res) => {
- this.dataList = res.data.records;
- console.log(res.data.records);
- this.listTotal = res.data.total;
- this.listLoading = false;
- });
- },
- handleRevoke(id) {
- handlePriceRevoke({ id }).then((res) => {
- this.$successMsg("操作成功");
- this.getList();
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-select--small {
- width: 100%;
- }
- ::v-deep .el-date-editor {
- width: 100%;
- }
- </style>
|