123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <template>
- <div class="zxDiffOrder pagePadding">
- <div v-if=" powers.some((i) => i == '001')">
- <ex-table
- :table="table"
- v-loading="loading"
- :data="tableData"
- :columns="columns"
- :page="pageInfo"
- :size="size"
- @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%">
- <el-row style="padding: 0 0 0 80px">
- <el-col :span="24">
- <el-col :span="6" style="width: 355px;">
- <period-date-picker
- :create_start="parmValue.create_start"
- :create_end="parmValue.create_end"
- :type="1"
- :width="'165px'"
- :size="searchSize"
- placeholder="创建"
- @timeReturned="timeReturned($event)"
- />
- </el-col>
- <el-col :span="4" style="margin-left: 10px">
- <el-select
- style="width:100%"
- placeholder="状态"
- v-model="parmValue.status"
- size="mini"
- clearable
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option
- v-for="s in statusOptions"
- :label="s.label"
- :value="s.id"
- :key="s.id"
- />
- </el-select>
- </el-col>
- <el-col :span="3" style="width: 66px; float: right">
- <el-button
- type="primary"
- :size="searchSize"
- @click="searchList"
- style="float: right; margin-left: 5px"
- >刷新</el-button>
- </el-col>
- <el-col :span="4" style="width: 66px; float: right">
- <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
- </el-col>
- </el-col>
- </el-row>
- <el-row style="margin-top: 10px">
- <el-col :span="6" style="width: 400px">
- <el-input
- v-model="value"
- :size="searchSize"
- placeholder="关键字"
- clearable
- :maxlength="40"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <template #prepend>
- <el-select
- v-model="parmValue.key"
- style="width:100px"
- @change="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- >
- <el-option label="商品名称" value="spuCode" />
- <el-option label="商品编码" value="good_name" />
- </el-select>
- </template>
- <el-button
- slot="appcreate_end"
- icon="el-icon-search"
- @click="
- pageInfo.curr = 1;
- parmValue.page = 1;
- searchList();
- "
- ></el-button>
- </el-input>
- </el-col>
- <el-button
- v-if="powers.includes('003') && !isSupertube"
- class="fr"
- type="success"
- size="mini"
- @click="getRouter('combinedAddDetail', 'add' )"
- >添加</el-button>
- </el-row>
- </div>
- </template>
- <template #status="{ scope }">
- <el-tag
- :size="tablebtnSize"
- :type="scope.row.status == '0' ? 'warning' : ''"
- v-text="
- (statusOptions.find((item) => item.id == scope.row.status) || {})
- .label || '--'
- "
- ></el-tag>
- </template>
- <template #order_source="{ scope }">
- <el-tag
- :size="tablebtnSize"
- v-text="
- (
- xs_order_source_options.find(
- (item) => item.id == scope.row.order_source
- ) || {}
- ).label || '--'
- "
- ></el-tag>
- </template>
- <template #catinfo="{ scope }">{{scope.row.catInfo.map(({name}) => name).join("-")}}</template>
- <template #specInfo="{ scope }">
- <span
- v-for="(si, sii) in scope.row.specInfo"
- :key="sii + si.spec_value_id"
- >{{ sii === 0 ? "" : "-" }}{{ si.spec_name }}[{{ si.spec_value }}]</span>
- </template>
- <template #order_type="{ scope }">
- <el-tag
- :size="tablebtnSize"
- v-text="
- (
- is_stock.find((item) => item.id == scope.row.is_stock) || {}
- ).name || '--'
- "
- ></el-tag>
- </template>
- <template #operation="{ scope }">
- <el-tooltip
- v-if="powers.some((i) => i == '007')"
- effect="dark"
- content="详情"
- placement="top"
- >
- <i class="el-icon-view tb-icon" @click="getRouter('combinedAddDetail', scope.row.id )"></i>
- </el-tooltip>
- </template>
- </ex-table>
- </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 "@/apis/service/sellOut/combinedAdd";
- import companyHelper from "@/mixins/companyHelper";
- import { mapGetters } from "vuex";
- import { columns } from "./columns";
- import {
- xs_order_source_options,
- xs_order_type_options
- } from "@/assets/js/statusList";
- export default {
- name: "zxDiffOrder",
- mixins: [mixinPage, resToken, companyHelper],
- computed: {
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
- powers() {
- const { btnList } = this.$store.getters;
- const tran = btnList.find(item => item.menu_route == "combinedAdd") || {};
- const { action } = tran ?? {};
- return action ?? [];
- }
- },
- data() {
- return {
- supplierNo: "",
- xs_order_source_options,
- xs_order_type_options,
- select: "1",
- input: "",
- addShowModel: false,
- addModelId: "",
- addIsDetail: false,
- customerCode: [],
- sitem: null,
- // 状态
- statusOptions: [
- { id: "1", label: "待审核" },
- { id: "2", label: "审核通过" },
- { id: "3", label: "审核驳回" }
- ],
- statusList: [
- "样品竞价单",
- "线上竞价",
- "线上贵金属",
- "线下竞价",
- "线下贵金属",
- "赠品竞价单",
- "项目竞聘"
- ],
- is_stock: [
- { id: "0", name: "非库存品" },
- { id: "1", name: "库存品" }
- ],
- key: "",
- value: "",
- loading: true,
- showModel: false,
- isDetail: false,
- modelId: 0,
- parmValue: {
- key: "spuCode",
- value: "",
- status: "",
- create_start: "",
- create_end: "",
- page: 1, // 页码
- size: 15 // 每页显示条数
- },
- tableData: [],
- passwordModel: false,
- passwordModelId: 0,
- isPasswordDetail: false,
- // 表格 - 数据
- tableData: [],
- // 表格 - 参数
- table: {
- stripe: true,
- border: true,
- _defaultHeader_: ["setcol"]
- },
- // 表格 - 分页
- pageInfo: {
- size: 15,
- curr: 1,
- total: 0
- },
- // 表格 - 列参数
- columns: columns
- };
- },
- mounted() {
- const { back } = this.$route.query;
- if (back) {
- this.parmValue = JSON.parse(back);
- console.log(this.parmValue);
- const { page, size } = this.parmValue;
- // this.parmValue.create_start = create_start || last_create_start;
- // this.parmValue.create_end = create_end || last_create_end;
- // if(this.parmValue.companyNo.length>0){
- // this.customerCode = [this.parmValue.companyNo] ;
- // }
- this.pageInfo = {
- size: size,
- curr: page,
- total: 0
- };
- //多选条件
- this.select = this.parmValue.select;
- // this.sselect = this.parmValue.sselect;
- this.s_input = this.parmValue.s_input;
- } else {
- this.select = "1";
- // this.sselect = "创建时间"
- }
- this.searchList();
- },
- methods: {
- async supplierChange(e) {
- const { code, label } = e;
- this.parmValue.supplierNo = code ? [code] : [];
- this.parmValue.supplierName = label;
- this.searchList();
- },
- getRouter(toRouter, queryId) {
- if (toRouter && queryId) {
- let model = {
- id: queryId
- // type: 'view',
- };
- //有多选框的条件
- this.parmValue.select = this.select;
- this.parmValue.s_input = this.s_input;
- //
- let routerModel = {
- options: JSON.parse(JSON.stringify(this.parmValue)),
- router: this.$route.path
- };
- model.preModel = JSON.stringify(routerModel);
- this.routeGoto(toRouter, model);
- } else {
- this.$message.warning("暂未找到相关流程!");
- }
- },
- async timeReturned(e) {
- if (e.create_startTime !== "") {
- this.parmValue.create_start = e.create_startTime;
- } else {
- this.parmValue.create_start = "";
- }
- if (e.create_endTime !== "") {
- this.parmValue.create_end = e.create_endTime;
- } else {
- this.parmValue.create_end = "";
- }
- if (
- this.parmValue.create_start !== "" &&
- this.parmValue.create_end !== ""
- ) {
- this.parmValue.page = 1;
- await this.searchList();
- }
- },
- restSearch() {
- // 表格 - 分页
- this.pageInfo = {
- size: 15,
- curr: 1,
- total: 0
- };
- this.select = "1";
- this.input = "";
- this.parmValue = {
- status: "",
- key: "spuCode",
- value: "",
- create_start: "",
- create_end: "",
- page: 1, // 页码
- size: 15 // 每页显示条数
- };
- this.searchList();
- },
- async customerChange(e) {
- if (e && e.id) {
- this.parmValue.customer_code = [e.code];
- this.parmValue.customerName = e.label;
- } else {
- this.parmValue.customer_code = [];
- this.parmValue.customerName = "";
- }
- this.parmValue.page = 1;
- await this.searchList();
- },
- openModal(id, isDetail) {
- this.showModel = true;
- this.modelId = id;
- this.isDetail = isDetail;
- },
- addModal(id, isDetail) {
- this.addModelId = id;
- this.addShowModel = true;
- this.addIsDetail = isDetail;
- },
- async deleteById(id, status) {
- await this.$confirm("确定要删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(async () => {
- const model = {
- id: id
- // status: status === "1" ? "0" : "1",
- };
- const res = await asyncRequest.delete(model);
- if (res && res.code === 0) {
- this.$notify.success({
- title: "删除成功",
- message: ""
- });
- this.searchList();
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- })
- .catch(() => {
- console.log("取消");
- });
- },
- async searchList() {
- if (
- (this.parmValue.create_start !== "" &&
- this.parmValue.create_end === "") ||
- (this.parmValue.create_start == "" && this.parmValue.create_end != "")
- ) {
- this.$message.warning("开始时间和结束时间不能为空");
- return;
- }
- this.loading = true;
- const { key, value, ...rest } = this.parmValue;
- const res = await asyncRequest.list({
- needRela: true,
- [key]: value,
- flag: "1",
- ...rest
- });
- if (res && res.code === 0 && res.data) {
- this.tableData = res.data.list;
- this.tableData.map(v => {
- v.sale_price = this.setNum(v.sale_price);
- v.sale_fee = this.setNum(v.sale_fee);
- v.class_cat = "";
- if (v.can && v.can.length > 0) {
- v.can.forEach((x, i) => {
- v.class_cat += i === 0 ? x.name : "/" + x.name;
- });
- }
- return v;
- });
- 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;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .zxDiffOrder {
- }
- </style>
|