Commit 258ac99a authored by 刘殿昕's avatar 刘殿昕

购物车解决报错,数据问题和展示形式,table-inputNumber扩展

parent 14ec2c15
...@@ -15,14 +15,20 @@ ...@@ -15,14 +15,20 @@
/> />
<div class="shopping_cell_msg"> <div class="shopping_cell_msg">
<div class="shopping_cell_name"> <div class="shopping_cell_name">
{{ cellItems.service.name }} {{ cellIsService ? cellItems.service.name:cellItems.application.app_name }}
<span <span
v-if="cellItems.service.data_service_type1_name == '时空服务'" v-if="cellIsService && cellItems.service.data_service_type1_name == '时空服务'"
class="tags map_service" class="tags map_service"
>mapService</span> >mapService</span>
<span v-if="cellItems.service.openness == 1" class="tags shared">共享</span> <span v-if="cellIsService && cellItems.service.openness == 1" class="tags shared">共享</span>
<span v-else-if="cellItems.service.openness == 2" class="tags restricted">受限</span> <span
<span v-else class="tags sensitive">敏感</span> v-else-if="cellIsService && cellItems.service.openness == 2"
class="tags restricted"
>受限</span>
<span
v-else-if="cellIsService && cellItems.service.openness == 3"
class="tags sensitive"
>敏感</span>
</div> </div>
<div class="shopping_cell_msg_other"> <div class="shopping_cell_msg_other">
<div <div
...@@ -43,6 +49,7 @@ ...@@ -43,6 +49,7 @@
<div class="shopping_cell_specification_val_specification">规格:{{ getSpecification }}</div> <div class="shopping_cell_specification_val_specification">规格:{{ getSpecification }}</div>
<div <div
class="shopping_cell_specification_val_type" class="shopping_cell_specification_val_type"
v-if="cellIsService"
>申请方式:{{ specificationApplicationBtns[cellItems.duration_method - 1].value }}</div> >申请方式:{{ specificationApplicationBtns[cellItems.duration_method - 1].value }}</div>
<div class="shopping_cell_specification_edit"> <div class="shopping_cell_specification_edit">
<el-popover <el-popover
...@@ -54,7 +61,9 @@ ...@@ -54,7 +61,9 @@
<div> <div>
<div v-if="cellIsService"> <div v-if="cellIsService">
<div class="shopping_cell_specification_title">规格:</div> <div class="shopping_cell_specification_title">规格:</div>
<div v-if="cellItems.service.request_spcs_info && cellItems.service.request_spcs_info.length != 0"> <div
v-if="cellItems.service.request_spcs_info && cellItems.service.request_spcs_info.length != 0"
>
<el-button <el-button
v-for="(item, index) in cellItems.service.request_spcs_info" v-for="(item, index) in cellItems.service.request_spcs_info"
:key="'specification' + index" :key="'specification' + index"
...@@ -77,8 +86,8 @@ ...@@ -77,8 +86,8 @@
>{{ index + 1 + ". " + item.value }}</el-button> >{{ index + 1 + ". " + item.value }}</el-button>
</div> </div>
</div> </div>
<div class="shopping_cell_specification_title">申请方式:</div> <div v-if="cellIsService" class="shopping_cell_specification_title">申请方式:</div>
<div> <div v-if="cellIsService">
<el-button <el-button
v-for="(item, index) in specificationApplicationBtns" v-for="(item, index) in specificationApplicationBtns"
:key="'specification' + index" :key="'specification' + index"
...@@ -198,7 +207,7 @@ export default { ...@@ -198,7 +207,7 @@ export default {
let num = arr.indexOf(this.cellItems.spec_id); let num = arr.indexOf(this.cellItems.spec_id);
let specification = ""; let specification = "";
if (num != -1) { if (num != -1) {
specification = this.cellItems.service.request_spec_info[num].value; specification = this.cellItems.service.request_spec_info[num].des;
} }
return specification; return specification;
} else { } else {
......
...@@ -26,7 +26,12 @@ ...@@ -26,7 +26,12 @@
</div> </div>
<div class="shopping_list shopping_list_fail"> <div class="shopping_list shopping_list_fail">
<div class="expired_service">已失效服务</div> <div class="expired_service">已失效服务</div>
<ShoppingCartList :readOnly="true" :list="listIn" class="shopping_all_list" /> <ShoppingCartList
:readOnly="true"
:list="listIn"
:checkList="checkListIn"
class="shopping_all_list"
/>
</div> </div>
<div class="shopping_list shopping_list_options"> <div class="shopping_list shopping_list_options">
<div class="shopping_cart_options"> <div class="shopping_cart_options">
...@@ -43,7 +48,7 @@ ...@@ -43,7 +48,7 @@
>删除选中服务</span> >删除选中服务</span>
</el-col> </el-col>
<el-col :span="15" class="shopping_cart_options_num"> <el-col :span="15" class="shopping_cart_options_num">
{{ checkList.length }} 项服务,已选择 {{ list.length }} 项服务,已选择
<span>{{ getNum }}</span> <span>{{ getNum }}</span>
</el-col> </el-col>
<el-col :span="4" class="shopping_cart_options_cell"> <el-col :span="4" class="shopping_cart_options_cell">
...@@ -74,6 +79,7 @@ export default { ...@@ -74,6 +79,7 @@ export default {
data: () => ({ data: () => ({
checkShopAll: false, checkShopAll: false,
checkList: [], checkList: [],
checkListIn: [],
list: [], list: [],
listIn: [] listIn: []
}), }),
...@@ -93,12 +99,14 @@ export default { ...@@ -93,12 +99,14 @@ export default {
getList() { getList() {
this.$api.serviceShop.getShoppingCart().then(response => { this.$api.serviceShop.getShoppingCart().then(response => {
if (response.data.success == "1") { if (response.data.success == "1") {
console.log(response.data.data);
this.list = response.data.data.valid; this.list = response.data.data.valid;
this.listIn = response.data.data.invalid; this.listIn = response.data.data.invalid;
for (const index in this.list) { for (const index in this.list) {
this.checkList.push(false); this.checkList.push(false);
} }
for (const index in this.listIn) {
this.checkListIn.push(false);
}
} else { } else {
console.log(response.data.message); console.log(response.data.message);
} }
...@@ -143,6 +151,7 @@ export default { ...@@ -143,6 +151,7 @@ export default {
let arr = []; let arr = [];
this.checkList.forEach((item, index) => { this.checkList.forEach((item, index) => {
if (item === true) { if (item === true) {
this.list[index].selected = Number(this.list[index].selected);
arr.push(this.list[index]); arr.push(this.list[index]);
} }
}); });
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<ShoppingCartCell <ShoppingCartCell
v-for="(item, index) in list" v-for="(item, index) in list"
:cellItem="item" :cellItem="item"
:cellIsService="item.service_id == 0 ? false:true" :cellIsService="item.app_id == 0"
:cellIndex="index" :cellIndex="index"
:cellCheck="checkLists[index]" :cellCheck="checkLists[index]"
:key="item.id" :key="item.id"
...@@ -35,10 +35,7 @@ export default { ...@@ -35,10 +35,7 @@ export default {
type: Array type: Array
}, },
checkList: { checkList: {
type: Array, type: Array
default: () => {
[];
}
} }
}, },
watch: { watch: {
......
<template> <template>
<div> <div>
<div v-if="typeHead == 'inputNumber'" class="text-xs-center">
<el-input
ref="inpNum"
v-model="inputText"
oninput="value=value.replace(/[^\d]/g, '')"
:disabled="couldNotEdit || name == ''"
size="small"
@input="changeValue"
class="table_in_input"
></el-input>
</div>
<div <div
v-if="typeHead == 'input' || type == '' || (typeHead == 'upload' && type == 'text')" v-else-if="typeHead == 'input' || type == '' || (typeHead == 'upload' && type == 'text')"
class="text-xs-center" class="text-xs-center"
> >
<el-input <el-input
...@@ -55,7 +66,7 @@ export default { ...@@ -55,7 +66,7 @@ export default {
default: "" default: ""
}, },
id: { id: {
type: [String,Number], type: [String, Number],
default: "" default: ""
}, },
name: { name: {
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
></v-apaas-table-umhref> ></v-apaas-table-umhref>
<!-- could edit --> <!-- could edit -->
<v-apaas-table-input <v-apaas-table-input
v-else-if="item.type === 'input' || item.type === 'upload'" v-else-if="item.type === 'input' || item.type === 'upload' || item.type === 'inputNumber'"
:item="helper.GetProperty(scope.row, item.prop)" :item="helper.GetProperty(scope.row, item.prop)"
:header="item.prop" :header="item.prop"
:id="scope.row.id" :id="scope.row.id"
...@@ -267,9 +267,9 @@ export default { ...@@ -267,9 +267,9 @@ export default {
}, },
props: { props: {
//是否控制5行显示 //是否控制5行显示
isLoad:'', isLoad: "",
//是否滚动加载 //是否滚动加载
asyn_load1:{ type: Boolean, default: false }, asyn_load1: { type: Boolean, default: false },
// 表格型号:mini,medium,small // 表格型号:mini,medium,small
size: { type: String, default: "medium" }, size: { type: String, default: "medium" },
loading: { type: Boolean, default: false }, loading: { type: Boolean, default: false },
...@@ -434,9 +434,9 @@ export default { ...@@ -434,9 +434,9 @@ export default {
} }
}, },
methods: { methods: {
asynload(){ asynload() {
console.log('111'); console.log("111");
if(this.asyn_load1){ if (this.asyn_load1) {
this.$emit("load_data"); this.$emit("load_data");
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment