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

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

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