123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- <template>
- <div class="zixunOrder pagePadding">
- <!-- <div>{{ powers }}---{{ is_project }}</div> -->
- <ex-table
- v-loading="loading"
- :table="table"
- :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 #good_img="{ scope }">
- <div
- v-if="scope.row.good_img"
- style="width: 20px; height: 20px"
- class="hover"
- v-viewer
- >
- <img
- :src="scope.row.good_img"
- style="display: inline-block; width: 100%; height: 100%"
- alt=""
- />
- </div>
- </template>
- <template #status="{ scope }">
- <el-tag
- :size="tablebtnSize"
- :type="
- (statusOptions.find((item) => item.id == scope.row.status) || {})
- .type || ''
- "
- v-text="
- (statusOptions.find((item) => item.id == scope.row.status) || {})
- .label || '--'
- "
- ></el-tag>
- </template>
- <template #specinfo="{ scope }">
- <span v-for="(si, sii) in scope.row.specinfo" :key="si.specid + sii">
- <span v-if="sii !== 0"></span>{{ si.spec_name }}[{{
- si.spec_value_name
- }}]</span
- >
- </template>
- <template #operation="{ scope }">
- <!-- 状态 -->
- <el-tooltip
- v-if="powers.some((item) => item == '007')"
- effect="dark"
- content="详情"
- placement="top"
- >
- <i class="el-icon-view tb-icon" @click="show_view(scope.row)"></i>
- </el-tooltip>
- <!-- {{ status }}-- {{ scope.row.status }} -->
- <el-tooltip
- v-if="
- powers &&
- powers.length > 0 &&
- powers.some((item) => item == '068') &&
- is_project === '0' &&
- (status === '2' ||
- status === '7' ||
- (status === '3' &&
- scope.row.status !== '3' &&
- scope.row.status !== '4' &&
- scope.row.status !== '6'))
- "
- effect="dark"
- content="发起议价流程"
- placement="top"
- >
- <i
- class="el-icon-s-flag tb-icon"
- @click="wantBargaining(scope.row)"
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- powers &&
- powers.length > 0 &&
- powers.some((item) => item == '069') &&
- is_project === '0' &&
- scope.row.status !== '6' &&
- (status == '3' || status == '2' || status == '7')
- "
- effect="dark"
- content="选择该商品"
- placement="top"
- >
- <i
- class="el-icon-s-check tb-icon"
- @click="change_goods(scope.row.bidNo)"
- ></i>
- </el-tooltip>
- <el-tooltip
- v-if="
- powers &&
- powers.length > 0 &&
- powers.some((item) => item == '070') &&
- is_project === '0' &&
- scope.row.status === '6' &&
- status == '4'
- "
- effect="dark"
- content="下单"
- placement="top"
- >
- <i
- class="el-icon-shopping-cart-2 tb-icon"
- @click="buy_goods(scope.row)"
- ></i>
- </el-tooltip>
- </template>
- </ex-table>
- <add-edit-bargain
- :showModel="wantBmodel"
- :sitem="wantBsitem"
- @cancel="wantBmodel = false"
- @refresh="(wantBmodel = false), $emit('resGoodOk')"
- />
- <buy-good-modal
- :showModel="bayGoodShowModel"
- :sitem="bayGoodItem"
- @cancel="bayGoodShowModel = false"
- @refresh="(bayGoodShowModel = false), $emit('resGoodOk')"
- />
- </div>
- </template>
- <script>
- import mixinPage from "@/mixins/elPaginationHandle";
- import resToken from "@/mixins/resToken";
- import asyncRequest from "@/apis/service/sellOut/zixunOrder";
- import { feedbackListCol } from "../columns";
- import { mapGetters } from "vuex";
- import addEditBargain from "./addEditBargain";
- import buyGoodModal from "./buyGoodModal";
- export default {
- name: "zixunOrder",
- mixins: [mixinPage, resToken],
- props: ["id", "newTime", "sitem"],
- components: {
- addEditBargain,
- buyGoodModal,
- },
- computed: {
- ...mapGetters(["tablebtnSize", "searchSize", "size"]),
- powers() {
- let tran =
- this.$store.getters.btnList.find(
- (item) => item.menu_route == "zixunOrderDetail"
- ) || {};
- if (tran && tran.action && tran.action.length > 0) {
- return tran.action;
- } else {
- return [];
- }
- },
- },
- watch: {
- newTime: function (val) {
- if (val) {
- const { is_project, status } = this.sitem;
- this.is_project = is_project;
- this.status = status;
- this.searchList();
- }
- },
- },
- data() {
- return {
- view_spuCode: "",
- view_show: false,
- wantBmodel: false,
- wantBsitem: "",
- select: "1",
- s_input: "",
- status: "",
- bayGoodShowModel: false,
- bayGoodItem: {},
- is_project: false,
- customerCode: [], //客户公司code
- options: [
- { id: "0", label: "待发布竞标" },
- { id: "1", label: "招标进行中" },
- { id: "2", label: "招标已结束" },
- { id: "3", label: "待选择商品" },
- { id: "4", label: "已选商品待下单" },
- { id: "5", label: "已成功转单" },
- { id: "6", label: "已取消转单" },
- { id: "7", label: "招标已暂停" },
- ],
- sitem: null,
- // 状态
- statusOptions: [
- { id: "0", label: "采返已结束", type: "info" },
- { id: "1", label: "采返已结束", type: "info" },
- { id: "2", label: "采返已结束", type: "info" },
- { id: "3", label: "等待议价结果", type: "warning" },
- { id: "4", label: "等待议价结果", type: "warning" },
- { id: "5", label: "议价已结束", type: "" },
- { id: "6", label: "已选择该商品", type: "success" },
- // 0待提交1待任务结束 2 待咨询确认 3议价待财务定价4 待主管确认5 待咨询确认定价6 咨询确认
- ],
- loading: true,
- showModel: false,
- isDetail: false,
- modelId: 0,
- parmValue: {
- zxNo: "",
- infoNo: "",
- bidNo: "",
- projectNo: "",
- page: 1, // 页码
- size: 15, // 每页显示条数
- },
- // 表格 - 数据
- tableData: [],
- // 表格 - 参数
- table: {
- stripe: true,
- border: true,
- // _defaultHeader_: ["setcol"],
- },
- // 表格 - 分页
- pageInfo: {
- size: 15,
- curr: 1,
- total: 0,
- },
- // 表格 - 列参数
- columns: feedbackListCol,
- };
- },
- mounted() {
- console.log(this.sitem);
- const { is_project, status } = this.sitem;
- this.is_project = is_project;
- this.status = status;
- this.searchList();
- },
- methods: {
- restSearch() {
- this.parmValue = {
- zxNo: "",
- infoNo: "",
- bidNo: "",
- projectNo: "",
- page: 1, // 页码
- size: 15, // 每页显示条数
- };
- // 表格 - 分页
- this.pageInfo = {
- size: 15,
- curr: 1,
- total: 0,
- };
- this.searchList();
- },
- wantBargaining(row) {
- this.wantBsitem = row;
- this.wantBmodel = true;
- },
- openModal(id, isDetail, sitem) {
- this.showModel = true;
- this.modelId = id;
- this.isDetail = isDetail;
- this.sitem = sitem;
- },
- // 列表搜索
- async searchList() {
- this.loading = true;
- this.parmValue.infoNo = this.id;
- const res = await asyncRequest.feedList(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 change_goods(bidNo) {
- await this.$confirm("确定要选择该商品下单?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- this.loading = true;
- const model = {
- bidNo: bidNo,
- };
- const res = await asyncRequest.bidscheck(model);
- if (res && res.code === 0) {
- this.loading = false;
- this.$notify.success({
- title: "选择商品成功!",
- message: "",
- });
- this.$emit("resGoodOk");
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- })
- .catch(() => {
- console.log("取消");
- });
- },
- async statusConfirm(id, status) {
- let str = status === "1" ? "禁用" : "启用";
- await this.$confirm("确定要改为" + str + "?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(async () => {
- this.loading = true;
- const model = {
- id: id,
- status: status === "1" ? "0" : "1",
- };
- const res = await asyncRequest.status(model);
- if (res && res.code === 0) {
- this.loading = false;
- this.$notify.success({
- title: "状态修改成功!",
- message: "",
- });
- await this.searchList();
- } else if (res && res.code >= 100 && res.code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(res.message);
- }
- })
- .catch(() => {
- console.log("取消");
- });
- },
- buy_goods(row) {
- const { company, khname, platform_name, arrival_time, num } = this.sitem;
- this.bayGoodItem = JSON.parse(JSON.stringify(row));
- this.bayGoodItem.in_company = company;
- this.bayGoodItem.in_khname = khname;
- this.bayGoodItem.in_platform_name = platform_name;
- this.bayGoodItem.in_arrival_time = arrival_time;
- this.bayGoodItem.in_num = num;
- this.bayGoodShowModel = true;
- // console.log(row);
- },
- // 时间选择事件
- async handleTime(e) {
- if (e.startTime !== "") {
- this.parmValue.start = e.startTime;
- } else {
- this.parmValue.start = "";
- }
- if (e.endTime !== "") {
- this.parmValue.end = e.endTime;
- } else {
- this.parmValue.end = "";
- }
- if (this.parmValue.start !== "" && this.parmValue.end !== "") {
- this.pageInfo.curr = 1;
- this.parmValue.page = 1;
- await this.searchList();
- }
- },
- async customerChange(e) {
- if (e && e.id) {
- this.customerCode = [e.code];
- this.parmValue.customer_code = e.code;
- } else {
- this.customerCode = [];
- this.parmValue.customer_code = "";
- }
- this.pageInfo.curr = 1;
- this.parmValue.page = 1;
- await this.searchList();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .zixunOrder {
- }
- </style>
-
|