|
@@ -1,302 +0,0 @@
|
|
|
-<template>
|
|
|
- <div v-if="allList[index]">
|
|
|
- <div class="project-backGoodShow" v-loading="allList[index].loading">
|
|
|
- <div class="project-backGoodShow-main">
|
|
|
- <div class="project-backGoodShow-title">
|
|
|
- 商品要求{{ index + 1 }}
|
|
|
- <el-button-group :size="'mini'" class="fr" style="margin: 8px 0 0 0">
|
|
|
- <el-button
|
|
|
- class="fr"
|
|
|
- v-if="index !== 0"
|
|
|
- type="primary"
|
|
|
- :size="'mini'"
|
|
|
- icon="el-icon-arrow-left"
|
|
|
- @click="index--"
|
|
|
- >上一个</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="fr"
|
|
|
- v-if="index + 1 !== allList.length"
|
|
|
- @click="next()"
|
|
|
- :size="'mini'"
|
|
|
- >下一个<i
|
|
|
- class="el-icon-arrow-right el-icon--right"
|
|
|
- :size="'mini'"
|
|
|
- ></i
|
|
|
- ></el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="fr"
|
|
|
- @click="next()"
|
|
|
- v-if="index + 1 === allList.length"
|
|
|
- :size="'mini'"
|
|
|
- >提交<i class="el-icon-upload el-icon--right"></i>
|
|
|
- </el-button>
|
|
|
- </el-button-group>
|
|
|
- </div>
|
|
|
- <div class="project-backGoodShow-ask-table">
|
|
|
- <template v-if="allList[index].ladder">
|
|
|
- <el-table
|
|
|
- :data="allList[index].ladder"
|
|
|
- :size="'mini'"
|
|
|
- border
|
|
|
- stripe
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column prop="good_type" label="商品类型" width="80px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag
|
|
|
- :size="'mini'"
|
|
|
- v-text="
|
|
|
- (
|
|
|
- statusOptions.find(
|
|
|
- (items) => items.value == scope.row.good_type
|
|
|
- ) || {}
|
|
|
- ).label || '--'
|
|
|
- "
|
|
|
- ></el-tag
|
|
|
- ></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="budget_price"
|
|
|
- label="预算单价"
|
|
|
- width="110"
|
|
|
- />
|
|
|
- <el-table-column prop="num" label="购买数量" width="110" />
|
|
|
- <el-table-column prop="cat_name" label="商品分类" />
|
|
|
- <el-table-column prop="good_img" label="图片" width="50">
|
|
|
- <template slot-scope="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>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="good_name" label="商品名称" />
|
|
|
- </el-table>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <div class="project-backGoodShow-title">商品反馈情况</div>
|
|
|
- <div class="project-backGoodShow-backGood-table">
|
|
|
- <template v-if="allList[index].tableData">
|
|
|
- <ex-table
|
|
|
- v-loading="allList[index].loading"
|
|
|
- :table="table"
|
|
|
- :data="allList[index].tableData"
|
|
|
- :columns="columns"
|
|
|
- :page="allList[index].pageInfo"
|
|
|
- :size="'mini'"
|
|
|
- @page-curr-change="handlePageChange($event, index)"
|
|
|
- @page-size-change="handleSizeChange($event, index)"
|
|
|
- @screen-reset="
|
|
|
- allList[index].pageInfo.curr = 1;
|
|
|
- searchList(index);
|
|
|
- "
|
|
|
- @screen-submit="
|
|
|
- allList[index].pageInfo.curr = 1;
|
|
|
- searchList(index);
|
|
|
- "
|
|
|
- @selection="selection_change"
|
|
|
- >
|
|
|
- </ex-table>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
-import asyncRequest from "@/apis/service/good-share";
|
|
|
-import resToken from "@/mixins/resToken";
|
|
|
-import columnsForm from "./columnsForm";
|
|
|
-export default {
|
|
|
- name: "backGoodShow",
|
|
|
- props: ["showModel", "sitem", "id", "type", "newTime"],
|
|
|
- mixins: [resToken],
|
|
|
- watch: {
|
|
|
- // showModel: function (val) {
|
|
|
- // this.showModelThis = val;
|
|
|
- // if (val) {
|
|
|
- // this.initForm();
|
|
|
- // }
|
|
|
- // },
|
|
|
- // showModelThis(val) {
|
|
|
- // if (!val) {
|
|
|
- // this.$emit("cancel");
|
|
|
- // }
|
|
|
- // },
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- loading: false,
|
|
|
- allList: [],
|
|
|
- index: 0,
|
|
|
- projectNo: "",
|
|
|
- statusOptions: [
|
|
|
- { value: "1", label: "竞品" },
|
|
|
- { value: "2", label: "竞聘" },
|
|
|
- ],
|
|
|
- table: {
|
|
|
- stripe: true,
|
|
|
- border: true,
|
|
|
- // _defaultHeader_: ["setcol"],
|
|
|
- },
|
|
|
- // 表格 - 列参数
|
|
|
- columns: columnsForm,
|
|
|
- };
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.initForm();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //初始化整个组件
|
|
|
- async initForm() {
|
|
|
- this.loading = true;
|
|
|
- await this.initListData();
|
|
|
- this.loading = false;
|
|
|
- // console.log(this.allList);
|
|
|
- await this.searchList(this.index);
|
|
|
- },
|
|
|
- async next() {
|
|
|
- const { selection } = this.allList[this.index];
|
|
|
- if (selection.length === 0) {
|
|
|
- this.$message.warning("至少选择一个商品!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.index + 1 !== this.allList.length) {
|
|
|
- this.index++;
|
|
|
- await this.searchList(this.index);
|
|
|
- } else {
|
|
|
- await this.$confirm("确定要提交?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- this.$emit("selectEnd");
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.log("取消");
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- selection_change(e) {
|
|
|
- const { list } = e;
|
|
|
- this.allList[this.index].selection = JSON.parse(JSON.stringify(list));
|
|
|
- let change_all_list = [];
|
|
|
- this.allList.forEach((a, ai) => {
|
|
|
- const { selection } = a;
|
|
|
- if (selection && selection.length > 0) {
|
|
|
- selection.forEach((b) => {
|
|
|
- let item = JSON.parse(JSON.stringify(b));
|
|
|
- item.noIndex = ai + 1;
|
|
|
- change_all_list.push(item);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- this.$emit("tableChange", { list: change_all_list });
|
|
|
- },
|
|
|
-
|
|
|
- //初始化整个组件
|
|
|
- async initListData() {
|
|
|
- // console.log(this.sitem);
|
|
|
- this.allList = [];
|
|
|
- const { projectNo, ladder } = this.sitem;
|
|
|
- this.projectNo = projectNo;
|
|
|
- if (ladder && ladder.length > 0) {
|
|
|
- ladder.forEach((e) => {
|
|
|
- let item = JSON.parse(JSON.stringify(e));
|
|
|
- // console.log(item);
|
|
|
- let model = {
|
|
|
- ladder: [item],
|
|
|
- pageInfo: {
|
|
|
- size: 15,
|
|
|
- curr: 1,
|
|
|
- total: 0,
|
|
|
- },
|
|
|
- loading: true,
|
|
|
- selection: [],
|
|
|
- tableData: [],
|
|
|
- };
|
|
|
- this.allList.push(model);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- async allSearchList() {
|
|
|
- if (this.allList && this.allList.length > 0) {
|
|
|
- this.allList.forEach(async (e, i) => {
|
|
|
- await this.searchList(i);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- //页数选择
|
|
|
- async handlePageChange(e, index) {
|
|
|
- this.allList[index].pageInfo.curr = e;
|
|
|
- await this.searchList(index);
|
|
|
- },
|
|
|
- //页面条数选择
|
|
|
- async handleSizeChange(e, index) {
|
|
|
- this.allList[index].pageInfo.curr = 1;
|
|
|
- this.allList[index].pageInfo.size = e;
|
|
|
- await this.searchList(index);
|
|
|
- },
|
|
|
- async searchList(index) {
|
|
|
- const { pageInfo } = this.allList[index];
|
|
|
- const { size, curr } = pageInfo;
|
|
|
- this.allList[index].loading = true;
|
|
|
- let model = {
|
|
|
- page: curr,
|
|
|
- size: size,
|
|
|
- zxNo: "",
|
|
|
- infoNo: "",
|
|
|
- bidNo: "",
|
|
|
- projectNo: this.projectNo,
|
|
|
- };
|
|
|
- const { code, data } = await asyncRequest.back_good_list(model);
|
|
|
- if (code === 0) {
|
|
|
- const { list, count } = data;
|
|
|
- this.allList[index].tableData = list;
|
|
|
- this.allList[index].pageInfo.total = Number(count);
|
|
|
- } else if (code >= 100 && code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.allList[index].tableData = [];
|
|
|
- this.allList[index].pageInfo.total = 0;
|
|
|
- }
|
|
|
- this.allList[index].loading = false;
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
- <style lang="scss" scoped>
|
|
|
-.project-backGoodShow {
|
|
|
- box-sizing: border-box;
|
|
|
- width: 100%;
|
|
|
- padding: 2px 16px 16px 16px;
|
|
|
-
|
|
|
- .project-backGoodShow-main {
|
|
|
- // padding: 2px 16px 16px 16px;
|
|
|
- // background: #fefefe;
|
|
|
- // border-radius: 5px;
|
|
|
- // overflow: hidden;
|
|
|
- // border: 1px solid #f0f0f0;
|
|
|
- // margin: 0 0 16px 0;
|
|
|
- .project-backGoodShow-title {
|
|
|
- height: 48px;
|
|
|
- line-height: 48px;
|
|
|
- color: #676767;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|