|
@@ -13,7 +13,7 @@
|
|
|
stripe
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
- <el-table-column prop="pgNo" label="商品要求编码" width="180" />
|
|
|
+ <el-table-column prop="pgNo" label="商品要求编码" width="160" />
|
|
|
<el-table-column prop="good_type" label="商品类型" width="80px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag
|
|
@@ -34,7 +34,7 @@
|
|
|
width="110"
|
|
|
/>
|
|
|
<el-table-column prop="num" label="购买数量" width="110" />
|
|
|
- <el-table-column prop="cat_name" label="商品分类" />
|
|
|
+ <el-table-column prop="cat_name" label="商品分类" width="110" />
|
|
|
<el-table-column prop="good_img" label="图片" width="50">
|
|
|
<template slot-scope="scope">
|
|
|
<div
|
|
@@ -57,7 +57,7 @@
|
|
|
</div>
|
|
|
<div class="project-backGoodShow-title">商品反馈情况</div>
|
|
|
<div class="project-backGoodShow-backGood-table">
|
|
|
- <template v-if="tableData">
|
|
|
+ <template v-if="tableData && columns && columns.length > 0">
|
|
|
<ex-table
|
|
|
v-loading="loading"
|
|
|
:table="table"
|
|
@@ -76,22 +76,40 @@
|
|
|
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>
|
|
|
</ex-table>
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="project-backGoodShow-title">
|
|
|
选择方案
|
|
|
+ <span v-if="plan_show" class="fr"
|
|
|
+ >方案总金额:{{ plan_show.sale_total }}元</span
|
|
|
+ >
|
|
|
<el-button-group
|
|
|
:size="'mini'"
|
|
|
class="fr"
|
|
|
- v-if="table_type === 'list'"
|
|
|
+ v-if="status==='4'"
|
|
|
style="margin: 8px 0 0 0"
|
|
|
>
|
|
|
<el-button
|
|
|
class="fr"
|
|
|
type="primary"
|
|
|
:size="'mini'"
|
|
|
- v-if="index !== 0 && total !== 0"
|
|
|
+ :disabled="index === 0"
|
|
|
+ v-if="total !== 0"
|
|
|
icon="el-icon-arrow-left"
|
|
|
@click="index--, change_plan()"
|
|
|
></el-button>
|
|
@@ -106,7 +124,8 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
class="fr"
|
|
|
- v-if="index + 1 !== total && total !== 0"
|
|
|
+ v-if="total !== 0"
|
|
|
+ :disabled="index + 1 === total"
|
|
|
@click="index++, change_plan()"
|
|
|
:size="'mini'"
|
|
|
><i
|
|
@@ -114,79 +133,102 @@
|
|
|
:size="'mini'"
|
|
|
></i
|
|
|
></el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="fr"
|
|
|
+ v-if="total !== 0"
|
|
|
+ @click="add_plan"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ :size="'mini'"
|
|
|
+ >选定方案,并提交
|
|
|
+ </el-button>
|
|
|
</el-button-group>
|
|
|
- </div>
|
|
|
- <div class="project-backGoodShow-ask-table">
|
|
|
- <template v-if="plan_table">
|
|
|
- <el-table
|
|
|
- :data="plan_table"
|
|
|
+ <!-- <el-button
|
|
|
+ type="primary"
|
|
|
+ class="fr"
|
|
|
+ @click="save_plan"
|
|
|
:size="'mini'"
|
|
|
- border
|
|
|
- stripe
|
|
|
- style="width: 100%"
|
|
|
+ >保存方案<i class="el-icon-upload el-icon--right"></i>
|
|
|
+ </el-button> -->
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="project-setPlan-backGood-table"
|
|
|
+ v-if="plan_show && plan_show.feedback && plan_show.feedback.length"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ :data="plan_show.feedback"
|
|
|
+ :size="'mini'"
|
|
|
+ border
|
|
|
+ stripe
|
|
|
+ :ref="'multipleTable' + index"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="pgNo"
|
|
|
+ label="要求编码"
|
|
|
+ width="180px"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="sale_price"
|
|
|
+ label="销售单价"
|
|
|
+ width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
>
|
|
|
- <el-table-column prop="pgNo" label="商品要求编码" width="180" />
|
|
|
- <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 class="table-change-footer" v-if="total !== 0">
|
|
|
- <span>项目总金额:{{ total }}元</span>
|
|
|
- <el-button-group
|
|
|
- :size="'mini'"
|
|
|
- class="fr"
|
|
|
- style="margin: 8px 0 0 0"
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.sale_price }}元</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="num"
|
|
|
+ label="购买数量"
|
|
|
+ width="110"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="good_img"
|
|
|
+ label="图片"
|
|
|
+ width="50"
|
|
|
+ show-overflow-tooltip
|
|
|
>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="fr"
|
|
|
- v-if="index + 1 !== total && total !== 0"
|
|
|
- @click="index++, change_plan()"
|
|
|
- :size="'mini'"
|
|
|
- >选中该方案
|
|
|
- <i
|
|
|
- class="el-icon-arrow-right el-icon--right"
|
|
|
- :size="'mini'"
|
|
|
- ></i
|
|
|
- ></el-button>
|
|
|
- </el-button-group>
|
|
|
- </div>
|
|
|
+ <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="商品名称"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="class_cat"
|
|
|
+ label="商品分类"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="model"
|
|
|
+ label="规格"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="delivery_day"
|
|
|
+ label="物流时间"
|
|
|
+ width="85"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -247,7 +289,11 @@ export default {
|
|
|
// _defaultHeader_: ["setcol"],
|
|
|
},
|
|
|
// 表格 - 列参数
|
|
|
- columns: columnsForm,
|
|
|
+ columns: [],
|
|
|
+ plan_show: {
|
|
|
+ sale_total: "0",
|
|
|
+ feedback: [],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -256,14 +302,86 @@ export default {
|
|
|
methods: {
|
|
|
//初始化整个组件
|
|
|
async initForm() {
|
|
|
+ this.columns = [];
|
|
|
this.loading = true;
|
|
|
+ let list = JSON.parse(JSON.stringify(columnsForm));
|
|
|
+ list.shift();
|
|
|
+ this.columns = list;
|
|
|
this.tableData = [];
|
|
|
await this.initListData();
|
|
|
+ await this.get_plan();
|
|
|
// console.log(this.allList);
|
|
|
this.loading = false;
|
|
|
// console.log(this.allList);
|
|
|
},
|
|
|
+ async add_plan() {
|
|
|
+ const { planNo, status } = JSON.parse(
|
|
|
+ JSON.stringify(this.allPlanList[this.index])
|
|
|
+ );
|
|
|
+ if (status === "1") {
|
|
|
+ this.$message.warning("该方案已选中!不能再选!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ await this.$confirm(`方案只能选择一次,您确定选定该方案么?`, {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ this.loading = true;
|
|
|
+ const model = {
|
|
|
+ planNos: [planNo],
|
|
|
+ status: "1",
|
|
|
+ };
|
|
|
+ const res = await asyncRequest.change_project_plan(model);
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ this.loading = false;
|
|
|
+ this.$notify.success({
|
|
|
+ title: "方案选择成功!",
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ this.$emit("refresh");
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ console.log("取消");
|
|
|
+ });
|
|
|
|
|
|
+ const { code, data } = await asyncRequest.back_good_list(model);
|
|
|
+ if (code === 0) {
|
|
|
+ const { list, count } = data;
|
|
|
+ this.tableData = list;
|
|
|
+ this.tableData.map((v) => {
|
|
|
+ v.class_cat = "";
|
|
|
+ if (v.can && v.can.length > 0) {
|
|
|
+ v.can.forEach((x, i) => {
|
|
|
+ v.class_cat += i === 0 ? x.name : "_" + x.name;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ v.model = "";
|
|
|
+ if (v.specinfo && v.specinfo.length > 0) {
|
|
|
+ v.specinfo.forEach((x, i) => {
|
|
|
+ v.model += `${i !== 0 ? "--" : ""}${x.spec_name}[${
|
|
|
+ x.spec_value_name
|
|
|
+ }]`;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ this.pageInfo.total = Number(count);
|
|
|
+ } else if (code >= 100 && code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.tableData = [];
|
|
|
+ this.pageInfo.total = 0;
|
|
|
+ }
|
|
|
+ // change_project_plan
|
|
|
+ },
|
|
|
//初始化整个组件
|
|
|
async initListData() {
|
|
|
// console.log(this.sitem);
|
|
@@ -310,6 +428,14 @@ export default {
|
|
|
v.class_cat += i === 0 ? x.name : "_" + x.name;
|
|
|
});
|
|
|
}
|
|
|
+ v.model = "";
|
|
|
+ if (v.specinfo && v.specinfo.length > 0) {
|
|
|
+ v.specinfo.forEach((x, i) => {
|
|
|
+ v.model += `${i !== 0 ? "--" : ""}${x.spec_name}[${
|
|
|
+ x.spec_value_name
|
|
|
+ }]`;
|
|
|
+ });
|
|
|
+ }
|
|
|
return v;
|
|
|
});
|
|
|
this.pageInfo.total = Number(count);
|
|
@@ -323,36 +449,44 @@ export default {
|
|
|
},
|
|
|
//获取全部方案
|
|
|
async get_plan() {
|
|
|
- if (!this.loading) {
|
|
|
- this.loading = true;
|
|
|
- let model = {
|
|
|
- projectNo: this.projectNo,
|
|
|
- };
|
|
|
- const { code, data } = await asyncRequest.pet_project_plan(model);
|
|
|
- if (code === 0) {
|
|
|
- const { plan } = data;
|
|
|
- this.allPlanList = JSON.parse(JSON.stringify(plan));
|
|
|
- this.total = this.allPlanList.length;
|
|
|
- this.index = 0;
|
|
|
- await this.change_plan();
|
|
|
- } else if (code >= 100 && code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message);
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
+ let model = {
|
|
|
+ projectNo: this.projectNo,
|
|
|
+ type: this.status === "5" || this.status === "6" ? "1" : "",
|
|
|
+ };
|
|
|
+ const { code, data, message } = await asyncRequest.get_project_plan(
|
|
|
+ model
|
|
|
+ );
|
|
|
+ if (code === 0) {
|
|
|
+ this.allPlanList = JSON.parse(JSON.stringify(data));
|
|
|
+ this.total = this.allPlanList.length;
|
|
|
+ this.index = 0;
|
|
|
+ await this.change_plan("1");
|
|
|
+ } else if (code >= 100 && code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(message);
|
|
|
}
|
|
|
},
|
|
|
//切换当前展示的方案
|
|
|
- async change_plan() {
|
|
|
- // this.table_type = "list";
|
|
|
- // if (type) {
|
|
|
- // this.index = 0;
|
|
|
- // }
|
|
|
-
|
|
|
- this.plan_tableData = JSON.parse(
|
|
|
+ async change_plan(type) {
|
|
|
+ this.plan_show = {
|
|
|
+ sale_total: "0",
|
|
|
+ feedback: [],
|
|
|
+ };
|
|
|
+ if (type) {
|
|
|
+ this.index = 0;
|
|
|
+ }
|
|
|
+ const { sale_total, feedback } = JSON.parse(
|
|
|
JSON.stringify(this.allPlanList[this.index])
|
|
|
);
|
|
|
+ this.plan_show = {
|
|
|
+ sale_total: sale_total,
|
|
|
+ feedback: JSON.parse(JSON.stringify(feedback)),
|
|
|
+ };
|
|
|
+ for (let i = 0; i < this.plan_show.feedback.length; i++) {
|
|
|
+ this.$set(this.plan_show.feedback[i], i, this.plan_show.feedback[i]);
|
|
|
+ }
|
|
|
+ console.log(this.plan_show);
|
|
|
},
|
|
|
},
|
|
|
};
|