123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545 |
- <template>
- <div class="app-container">
- <!-- 筛选条件 -->
- <div>
- <el-form
- ref="screenForm"
- :model="screenForm"
- label-width="70px"
- size="mini"
- label-position="left"
- >
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="物料编码" prop="materialNumber">
- <el-input
- v-model="screenForm.materialNumber"
- placeholder="请输入物料编码"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="产品名称" prop="materialName">
- <el-input
- v-model="screenForm.materialName"
- placeholder="请输入产品名称"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="产品编码" prop="materialOldNumber">
- <el-input
- v-model="screenForm.materialOldNumber"
- placeholder="请输入产品编码"
- />
- </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-select
- v-model="screenForm.saleTypeId"
- filterable
- placeholder="选择销售类型"
- style="width: 100%"
- >
- <el-option label="全部" value="" />
- <el-option
- v-for="item in ztypeList"
- :key="item.id"
- :label="item.saleName"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="产品类别" prop="k3CategoryNumber">
- <el-select
- v-model="screenForm.k3CategoryNumber"
- placeholder="请选择产品类别"
- >
- <el-option label="全部" value="" />
- <el-option
- v-for="item in dictList"
- :label="item.name"
- :value="item.number"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="规格型号" prop="specification">
- <el-input
- v-model="screenForm.specification"
- placeholder="请输入规格型号"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="备注" prop="remark">
- <el-input v-model="screenForm.remark" placeholder="请输入备注" />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="24" :lg="24" class="tr">
- <el-form-item label="">
- <el-button size="mini" @click="resetScreenForm">清空</el-button>
- <el-button size="mini" type="primary" @click="submitScreenForm"
- >搜索</el-button
- >
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <!-- 按钮 -->
- <div class="btn-group clearfix">
- <div>
- <el-popconfirm
- v-if="$checkBtnRole('del', $route.meta.roles)"
- confirm-button-text="好的"
- cancel-button-text="不用了"
- icon="el-icon-info"
- icon-color="red"
- title="内容确定删除吗?"
- @onConfirm="handleDelete"
- >
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-delete"
- slot="reference"
- class="el-popover-left"
- >删除</el-button
- >
- </el-popconfirm>
- <el-button
- type="primary"
- style="margin-left: 10px"
- size="mini"
- @click="handleRevokeAll"
- >批量作废</el-button
- >
- <!-- <ExportButton
- :exUrl="'product-upd-price/export'"
- :exParams="exParams"
- class="exp"
- /> -->
- <!-- <el-button type="primary" size="mini">打印</el-button> -->
- </div>
- <div class="fl">
- <!-- <el-popconfirm
- style="margin-right: 10px"
- title="批量作废吗?"
- @onConfirm="handleRevokeAll"
- >
- <el-button
- slot="reference"
- type="text"
- size="mini"
- >批量作废</el-button>
- </el-popconfirm> -->
- </div>
- </div>
- <div class="mymain-container">
- <!-- 列表 -->
- <div class="table">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- :row-class-name="tableRowClassName"
- @select-all="hanleSelectAll"
- @select="hanleSelectAll"
- >
- <el-table-column
- type="selection"
- align="left"
- width="50"
- ></el-table-column>
- <!-- <el-table-column type="selection" align="left" />-->
- <!-- <el-table-column
- align="left"
- label="产品类别"
- prop="mainName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column> -->
- <el-table-column
- align="left"
- label="物料编码"
- prop="materialNumber"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialNumber" />
- <span>{{ scope.row.materialNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="产品编码"
- prop="materialOldNumber"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialOldNumber" />
- <span>{{ scope.row.materialOldNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="产品名称"
- prop="materialName"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialName" />
- <span>{{ scope.row.materialName }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="规格型号"
- prop="specification"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.specification" />
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="销售类型"
- prop="saleTypeName"
- min-width="160"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- label="单位"
- prop="unit"
- min-width="160"
- show-overflow-tooltip
- />
- <!-- <el-table-column
- align="left"
- label="数量下限"
- prop="qty"
- min-width="160"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- 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
- :key="index"
- type="success"
- style="margin: 0 10px"
- size="mini"
- >
- {{ item.walletName }}
- </el-tag>
- </template>
- </template>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- 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
- :key="index"
- type="success"
- style="margin: 0 10px"
- size="mini"
- >
- {{ item.walletName }}
- </el-tag>
- </template>
- </template>
- </template>
- </el-table-column> -->
- <el-table-column
- align="left"
- label="生效日期"
- prop="startDate"
- min-width="160"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- label="失效日期"
- prop="endDate"
- min-width="160"
- show-overflow-tooltip
- />
- <!-- <el-table-column
- align="left"
- label="是否销价"
- prop="isPromote"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-tag size="mini" v-if="scope.row.isPromote" type="success"
- >是</el-tag
- >
- <el-tag size="mini" v-else type="danger">否</el-tag>
- </template>
- </el-table-column> -->
- <el-table-column
- align="left"
- label="是否作废"
- prop="isRevoke"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-tag size="mini" v-if="scope.row.isRevoke" type="success"
- >是</el-tag
- >
- <el-tag size="mini" v-else type="danger">否</el-tag>
- </template>
- </el-table-column>
- <el-table-column
- align="right"
- label="单价"
- prop="batchPrice"
- min-width="160"
- show-overflow-tooltip
- />
- <!-- <el-table-column
- align="right"
- label="格力折扣"
- prop="discAmount"
- min-width="160"
- show-overflow-tooltip
- /> -->
- <el-table-column
- align="left"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- />
- <el-table-column fixed="left" width="150" label="操作" align="center">
- <template slot-scope="scope">
- <el-popconfirm
- v-if="!scope.row.isRevoke"
- style="margin-right: 10px"
- title="作废吗?"
- @onConfirm="handleRevoke(scope.row.id)"
- >
- <el-button slot="reference" type="text" size="mini"
- >作废</el-button
- >
- </el-popconfirm>
- <el-button
- v-if="$checkBtnRole('del', $route.meta.roles)"
- type="text"
- size="mini"
- @click="handleDelete(scope.row.id)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="10"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </div>
- </div>
- </template>
- <script>
- import Mixin from "@/mixin/index";
- import {
- getProductDelete,
- getProductPriceList,
- getTypeList,
- handlePriceRevoke,
- } from "@/api/basic_data/material";
- import { getCategoryList } from "@/api/common";
- import ExportButton from "@/components/Common/export-button.vue";
- export default {
- mixins: [Mixin],
- data() {
- return {
- currentPage: 1,
- pageSize: 10,
- listTotal: 0,
- dataList: [],
- screenForm: {
- k3CategoryNumber: "",
- endDate: "",
- materialName: "",
- materialNumber: "",
- materialOldNumber: "",
- saleTypeId: "",
- specification: "",
- startDate: "",
- remark: "",
- },
- ztypeList: [],
- dictList: {},
- };
- },
- computed: {
- exParams() {
- return {
- k3CategoryNumber: this.screenForm.k3CategoryNumber,
- endDate: this.screenForm.endDate,
- materialName: this.screenForm.materialName,
- materialNumber: this.screenForm.materialNumber,
- materialOldNumber: this.screenForm.materialOldNumber,
- saleTypeId: this.screenForm.saleTypeId,
- specification: this.screenForm.specification,
- startDate: this.screenForm.startDate,
- remark: this.screenForm.remark,
- billType: "DIFF",
- };
- },
- },
- mounted() {
- getCategoryList({ pageNum: 1, pageSize: -1 }).then((res) => {
- this.dictList = res.data.records;
- console.log(this.dictList, 777777);
- });
- },
- methods: {
- addFn() {
- this.showDialogForm = true;
- },
- handleDelete(id) {
- this.hanleDeleteAllPromise(id).then((ids) => {
- getProductDelete(ids).then((res) => {
- this.$successMsg("删除成功");
- this.getList();
- });
- });
- },
- getList() {
- this.listLoading = true;
- const params = {
- pageNum: this.currentPage,
- pageSize: this.pageSize,
- k3CategoryNumber: this.screenForm.k3CategoryNumber,
- endDate: this.screenForm.endDate,
- materialName: this.screenForm.materialName,
- materialNumber: this.screenForm.materialNumber,
- materialOldNumber: this.screenForm.materialOldNumber,
- saleTypeId: this.screenForm.saleTypeId,
- specification: this.screenForm.specification,
- startDate: this.screenForm.startDate,
- remark: this.screenForm.remark,
- billType: "DIFF",
- };
- getProductPriceList(params).then((res) => {
- this.dataList = res.data.records;
- console.log(res.data.records);
- this.listTotal = res.data.total;
- this.listLoading = false;
- });
- getTypeList({ ...params, pageNum: 1, pageSize: -1 }).then((res) => {
- this.ztypeList = res.data.records;
- // console.log(this.ztypeList, "type1111");
- });
- },
- handleRevoke(id) {
- handlePriceRevoke({ ids: id }).then((res) => {
- this.$successMsg("操作成功");
- this.getList();
- });
- },
- handleRevokeAll() {
- handlePriceRevoke({ ids: this.ids.join("") }).then((res) => {
- this.$successMsg("操作成功");
- this.getList();
- });
- },
- tableRowClassName({ row, rowIndex }) {
- // || row.examineStatus=='FAIL'
- if (this.ids.includes(row.id)) {
- return "warning-row";
- }
- return "";
- },
- },
- components: { ExportButton },
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-table .warning-row {
- background: oldlace;
- }
- ::v-deep .el-select--small {
- width: 100%;
- }
- ::v-deep .el-date-editor {
- width: 100%;
- }
- .exp {
- display: inline-block;
- margin-left: 10px;
- }
- </style>
|