This commit is contained in:
JIAL 2024-08-13 14:03:09 +08:00
parent 6b2b20850c
commit 739d529047
6 changed files with 1001 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -204,6 +204,19 @@ export const constantRoutes = [
}
]
},
{
path: '/redBookMobile/productSelectMobile',
component: Layout,
hidden: true,
children: [
{
path: '',
component: () => import('@/views/mobile/redBookMobile/productSelectMobile'),
name: 'redBookMobile',
meta: { title: '报价单', activeMenu: '/mobile/redBookMobile/productSelectMobile' }
}
]
},
{
path: '/mobile/index',
component: Layout,

View File

@ -625,10 +625,7 @@ export default {
/** 保存按钮 */
async saveForm() {
const valid = await this.validateForm();
console.log(11111111)
if (valid) {
console.log(11111111)
this.form.bankList = this.bankList;
if (this.form.cusId != null) {
updateCustomer(this.form).then(response => {

View File

@ -12,14 +12,14 @@
<div class="app-name">询价单</div>
</el-card>
</el-col>
<!-- <el-col :span="8" class="app-icon-container">-->
<!-- <el-card shadow="always" class="app-icon-card" @click="handleClick('App2')">-->
<!-- <div class="app-icon">-->
<!-- <img src="https://via.placeholder.com/50" alt="App2">-->
<!-- </div>-->
<!-- <div class="app-name">App2</div>-->
<!-- </el-card>-->
<!-- </el-col>-->
<el-col :span="8" class="app-icon-container">
<el-card shadow="always" class="app-icon-card">
<div class="app-icon" @click="handleClick('redBookMobile')">
<img src="@/assets/logo/113.png" alt="报价">
</div>
<div class="app-name">报价</div>
</el-card>
</el-col>
<!-- Add more icons as needed for Section 1 -->
</el-row>
</div>
@ -92,10 +92,15 @@ export default {
},
methods: {
handleClick(appName) {
if(appName === 'redBookMobile') {
this.$router.push('/redBookMobile/productSelectMobile');
} else{
console.log(appName);
this.$router.push('/' + appName + '/index');
//
}
}
},
}
</script>

View File

@ -0,0 +1,959 @@
<template>
<div class="container">
<van-cell-group>
<van-search style="padding: 20px 12px 5px 12px" shape="round" v-model="queryParams.name_0" clearable placeholder="型号 模糊查询" ></van-search >
<van-search style="padding: 5px 12px" shape="round" v-model="queryParams.model" clearable placeholder="规格 模糊查询" ></van-search >
<div style="padding: 0px 40px 0px 40px">
<van-button style="width: 100%" size="small" round plain type="info" native-type="submit" @click="handleSearchClick">搜索</van-button>
</div>
</van-cell-group>
<van-collapse v-model="activeNames">
<!-- 目录面板 -->
<van-collapse-item :title="mlTitle" name="muLu">
<div class="content-wrapper level-1">
<div v-for="(item, index) in modelList" :key="index" class="content-item" @click="selModelTag(item)">{{item.name_0}}</div>
</div>
</van-collapse-item>
<!-- 型号面板 -->
<van-collapse-item v-if="showXinghList" :title="xhTitle" name="xingHao">
<div class="content-wrapper level-2">
<div v-for="(item, index) in xinghList" :key="index" class="content-item" @click="selXinghTag(item)">{{item.name_0}}</div>
</div>
</van-collapse-item>
<!-- 子类面板 -->
<van-collapse-item v-if="showZlList" :title="zlTitle" name="ziLei">
<div class="content-wrapper level-3">
<div v-for="(item, index) in zlList" :key="index" class="content-item" @click="selZlTag(item)">{{item.name_0}}</div>
</div>
</van-collapse-item>
<!-- 衍生型号面板 -->
<van-collapse-item v-if="showYsxhList" :title="ysxhTitle" name="ySXingHao">
<div class="content-wrapper level-4">
<div v-for="(item, index) in ysxhList" :key="index" class="content-item" @click="selYsxhTag(item)">{{item.name_0}}</div>
</div>
</van-collapse-item>
<!-- 截面面板 -->
<van-collapse-item v-if="showJmList" :title="jmTitle" name="jieMian">
<div class="content-wrapper level-5">
<div v-for="(item, index) in jmList" :key="index" class="content-item" @click="selJmTag(item)">{{item.section}}</div>
</div>
</van-collapse-item>
</van-collapse>
<van-loading v-if="loadingLogo" size="24px">加载中...</van-loading>
<van-list
v-if="searchResultData.length"
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div v-for="(result, index) in searchResultPagedData" :key="index">
<van-swipe-cell style="margin: 10px 0px">
<van-card
class="goods-card custom-card"
>
<template #title>
<span style="font-size: 15px; margin: 10px 20px 0px 0px">{{ result.model }}</span>
<span style="font-size: 15px; margin: 10px 20px 0px 0px">{{ result.spec }}</span>
<span style="font-size: 15px; margin: 10px 20px 0px 0px">{{ result.voltage }}</span>
</template>
<template #desc>
<div>
<div style="color: red;font-size: 15px; margin-top: 5px">{{ result.price + ' 元 / ' + result.stu }}</div>
</div>
</template>
</van-card>
<template #right>
<van-button square text="添加" @click="addItemToIsSelectList(result)" type="primary" class="delete-button" />
</template>
</van-swipe-cell>
</div>
</van-list>
<div style="position: fixed; bottom: 0;">
<van-goods-action safe-area-inset-bottom>
<van-goods-action-icon icon="cart-o" @click="shoppingCilck" text="选单" :badge="isSelectNumber" />
<van-goods-action-icon icon="shop-o" @click="infoClick" text="信息" />
<van-goods-action-button type="danger" @click="handleMadeQuotClick" text="生成报价单" />
</van-goods-action>
</div>
<!-- 优惠券列表 -->
<van-popup
v-model="showList"
round
position="bottom"
style="height: 90%; padding-top: 4px;"
>
<div style="padding-bottom: 60px">
<div v-for="(result, index) in isSelectList" :key="index">
<van-swipe-cell style="margin: 10px 0px">
<van-card
class="goods-card custom-card"
>
<template #title>
<div class="info-container">
<div class="column">
<span class="info-item">型号: {{ result.model }}</span>
<span class="info-item">电压: {{ result.voltage }}</span>
<span class="info-item">红本价(): {{ result.price }}</span>
<span class="info-item">
<van-field label-width="60px" label="一次折扣" v-model="result.per" placeholder="一次折扣" />
</span>
<span class="info-item">
<van-field label-width="60px" label="数量" v-model="result.count" placeholder="数量" />
</span>
</div>
<div class="column">
<span class="info-item">规格: {{ result.spec }}</span>
<span class="info-item">单位: {{ result.stu }}</span>
<span class="info-item">单价(): {{ result.setPrice }}</span>
<span class="info-item">
<van-field label-width="60px" label="二次折扣" v-model="result.per2" placeholder="二次折扣" />
</span>
<span class="info-item">总价: {{ result.allPrice }}</span>
</div>
</div>
</template>
<!-- <template #desc>-->
<!-- <div>-->
<!-- <div style="color: red;font-size: 15px; margin-top: 5px">{{ result.price + ' 元 / ' + result.stu }}</div>-->
<!-- </div>-->
<!-- </template>-->
</van-card>
<template #right>
<van-button square text="删除" @click="removeItemFromIsSelectList(index)" type="danger" class="delete-button" />
</template>
</van-swipe-cell>
</div>
<van-goods-action>
<van-goods-action-button color="#be99ff" @click="closeDialog" type="warning" text="取消" />
<van-goods-action-button color="#7232dd" type="danger" text="确认" />
</van-goods-action>
</div>
</van-popup>
<van-popup
v-model="showPanel"
round
position="bottom"
style="height: 90%; padding-top: 4px;">
<van-form ref="form" :model="form" :rules="rules">
<van-field
ref="quotCustomer"
v-model="form.quotCustomer"
label="询价单位"
placeholder="输入询价单位"
required
:rules="[{ required: true, message: '' }]">
</van-field>
<van-field
ref="quotProject"
v-model="form.quotProject"
label="项目名称"
placeholder="输入项目名称"
required
:rules="[{ required: true, message: '' }]">
</van-field>
<van-field
ref="quotLxr"
v-model="form.quotLxr"
label="联系人"
placeholder="请输入联系人"
required
:rules="[{ required: true, message: '' }]">
</van-field>
<van-field
ref="quotLxrdh"
v-model="form.quotLxrdh"
label="联系电话"
placeholder="请输入联系电话"
required
:rules="[{ required: true, message: '' }]">
</van-field>
<van-field
v-model="sumSelectedResultData"
label="总价"
placeholder="请输入总价"
readonly>
</van-field>
<van-field
ref="totalPrice"
v-model="form.totalPrice"
label="总金额"
placeholder="请输入总金额"
v-if="false">
</van-field>
<van-field
ref="perc"
v-model="form.perc"
label="一次折扣"
placeholder="请输入一次折扣"
@blur="changeData"
@keyup.enter.native="changeData">
</van-field>
<van-field
ref="perc2"
v-model="form.perc2"
label="二次折扣"
placeholder="请输入二次折扣"
@blur="changeData"
@keyup.enter.native="changeData">
</van-field>
<van-field
readonly
:value="redBookText"
name="redBookText"
label="调价"
placeholder="点击选择调价"
@click="searchResultTotal === 0 ? redBookShowPicker = false : redBookShowPicker = true"
/>
<van-popup v-model="redBookShowPicker" position="bottom">
<van-picker
value-key="label"
:default-index="0"
show-toolbar
:columns="versionList"
@confirm="redBookOnConfirm"
@cancel="redBookShowPicker = false"
/>
</van-popup>
</van-form>
<van-goods-action>
<van-goods-action-button color="#be99ff" @click="closeInfoDialog" type="warning" text="关闭" />
</van-goods-action>
</van-popup>
</div>
</template>
<script>
import {toDecimal, productList,versionList,getQuotDetail,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, madeQuot, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook";
import { getToken } from "@/utils/auth";
import { Dialog } from 'vant';
export default {
name: "productSelectMobile",
data() {
return {
redBookShowPicker: false,
redBookDicts: [], //
//
redBookText: '',
/**-----------------面板数据初始化-------------------**/
activeNames: ['muLu'], //
mlTitle: '目录',
xhTitle: '型号',
zlTitle: '子类',
ysxhTitle: '衍生型号',
jmTitle: '截面',
//
modelList: [],
//
showRemarkList: false,
remarkList: [],
//
showXinghList: false,
xinghList: [],
//
showZlList: false,
ZlList: [],
//
showYsxhList: false,
ysxhList: [],
//
showJmList: false,
jmList: [],
/**-----------------面板数据初始化-------------------**/
//
scrollableHeight:null,
//
tableHeight:null,
//
expandedIndex: -1, // -1
id: 1,
//
queryParams: {
},
//tag
selectedModelTag:"",
selectedModelUid:"",
//tag
selectedXinghTag:"",
selectedXinghUid:"",
//tag
selectedZlTag:"",
selectedZlUid:"",
//tag
selectedYsxhTag:"",
selectedYsxhUid:"",
//tag
selectedJmTag:"",
/**==============查询结果========================= */
//
searchResultLoading: false,
//
searchResultTotal: 0,
searchResultCurrentPage: 1,
searchResultPageSize: 10,
searchResultData: [],
errSlIndex: [],///
errPercIndex: [],///
errPerc2Index: [],///
/**==============已选择结果========================= */
selectedResultLoading: false,
//
selectedResultTotal: 0,
selectedResultCurrentPage: 1,
selectedResultPageSize: 10,
selectedResultData: [],
sliceResultData: [],
//
productUpload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/redBook/redBook/importData2"
},
//
/*perc: 0.8,
perc2: '',*/
//
form: {totalPrice: '',perc:0.8,perc2: 1},
rules: {
quotCustomer: [{ required: true, message: '客户名称不可为空' }],
quotProject: [{ required: true, message: '项目名称不可为空' }],
cusPhoneNumber: [{ required: true, message: '联系电话不可为空' }],
quotLxr: [{ required: true, message: '联系人不可为空' }],
},
//
versionList: [], //
madeQuotDis: false, //
hasNotMatch: true, //
total: 0,
loading: false,
finished: false,
searchMethod: null,
loadingLogo: false,
isSelectNumber: 0,
isSelectList: [],
showList: false,
showPanel: false,
};
},
created() {
const param = this.$route.query;
const that = this;
this.productList();
this.getVersionList().then(function(){
if (param.quotId !== undefined && param.quotId !== null) {
that.handleRefreshClick();
const row = {'quotId':param.quotId}
that.handleQuotInfo(row);
}
});
},
computed: {
//
searchResultPagedData() {
const startIndex = (this.searchResultCurrentPage - 1) * this.searchResultPageSize;
const endIndex = startIndex + this.searchResultPageSize;
this.sliceResultData = [...this.sliceResultData, ...this.searchResultData.slice(startIndex, endIndex)];
this.finished = this.sliceResultData.length >= this.searchResultTotal;
return this.sliceResultData;
},
//
/*selectedResultPagedData() {
console.log(this.selectedResultData)
const startIndex = (this.selectedResultCurrentPage - 1) * this.selectedResultPageSize;
const endIndex = startIndex + this.selectedResultPageSize;
return this.selectedResultData.slice(startIndex, endIndex);
},*/
//
isColumn1ValuesEqual() {
if(this.isSelectList.length > 0){
const uid_0 = this.isSelectList[0].uid_0;//uid
return this.isSelectList.every(row => row.uid_0 === uid_0);
}else{
return false;
}
},
//
sumSelectedResultData() {
const allPrice = this.isSelectList.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
return toDecimal(allPrice);
},
},
methods: {
async validateForm() {
try {
await this.$refs.form.validate();
return true;
} catch (error) {
console.error('Form validation failed:', error);
return false;
}
},
async handleMadeQuotClick() {
let flag = this.checkSlZk();
if(flag) {
const valid = await this.validateForm();
if(valid) {
this.form.selectedResultData = this.isSelectList;
madeQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功");
//
const content = response;
const blob = new Blob([content]);
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // URL
document.body.removeChild(elink);
}else {
// IE10+
navigator.msSaveBlob(blob, fileName);
}
});
console.log("通过")
} else {
Dialog.alert({
message: '请填写信息面板中所有的必填项!',
}).then(() => {
// on close
});
}
}
},
//
getTodayCourse(){
const myDate = new Date();
//
const year = myDate.getFullYear();
//
const month = myDate.getMonth() + 1;
//
const date = myDate.getDate();
const h = myDate.getHours(); //(0-23)
const m = myDate.getMinutes(); //(0-59)
const s = myDate.getSeconds();
return year + '-' + this.p(month) + "-" + this.p(date) + " " + this.p(h) + ':' + this.p(m) + ":" + this.p(s)
},
p(s) {
return s < 10 ? '0' + s : s;
},
// -
checkSlZk(){
let flag = true;
this.errSlIndex = [];
this.errPercIndex = [];
this.errPerc2Index = [];
let errMsg = "";
const label = /^(\+)?\d+(\.\d+)?$/;
let reg = new RegExp(label);
this.isSelectList.forEach((row, index) => {
//
let sl = row.count;
if(sl){
sl = String(sl).trim();
if (!reg.test(sl)) {
this.errSlIndex.push(index+1);
}
}
//
let perc = row.per;
if(perc){
perc = String(perc).trim();
if (!reg.test(perc)) {
this.errPercIndex.push(index+1);
}
}
//
let perc2 = row.per2;
if(perc2){
perc2 = String(perc2).trim();
if (!reg.test(perc2)) {
this.errPerc2Index.push(index+1);
}
}
});
if(this.errPercIndex.length!=0){
flag = false;
errMsg = "第"+this.errPercIndex.join(",")+"行报价产品明细【一次折扣】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
if(this.errPerc2Index.length!=0){
flag = false;
errMsg = "第"+this.errPerc2Index.join(",")+"行报价产品明细【二次折扣】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
if(this.errSlIndex.length!=0){
flag = false;
errMsg = "第"+this.errSlIndex.join(",")+"行报价产品明细【数量调整】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
return flag;
},
redBookOnConfirm(columns) {
this.redBookText = columns.label
this.redBookShowPicker = false;
this.isSelectList.forEach((row, index) => {
this.$set(this.isSelectList, index, {
...row,
uid_0: columns.value // uid
});
});
//-
updateSelectedResultData(this.isSelectList).then(response => {
for (let i = 0; i < this.isSelectList.length; i++) {
for (let j = 0; j < response.data.length; j++) {
//
if (
this.isSelectList[i].name_0 === response.data[j].name_0
) {
this.isSelectList[i].price = response.data[j].price;
const setPrice = toDecimal(this.isSelectList[i].price * (this.isSelectList[i].per?this.isSelectList[i].per:1) * (this.isSelectList[i].per2?this.isSelectList[i].per2:1));
const allPrice = toDecimal(this.isSelectList[i].count * this.isSelectList[i].price * (this.isSelectList[i].per?this.isSelectList[i].per:1) * (this.isSelectList[i].per2?this.isSelectList[i].per2:1));
this.isSelectList[i].setPrice = setPrice;
this.isSelectList[i].allPrice = allPrice;
}
}
}
this.madeQuotDis = false;
this.selectedResultLoading = false;
});
},
closeInfoDialog() {
this.showPanel = false;
},
closeDialog() {
this.showList = false;
},
shoppingCilck() {
this.showList = true;
},
/**------------------面板操作----------------**/
//
selModelTag(item) {
this.resetPanels(1);
this.mlTitle = `目录 - ${item.name_0}`;
this.selectedModelTag = item.name_0; //
//
this.productXinghList(item.uid_0);
},
changeData() {
const p1 = this.form.perc;
const p2 = this.form.perc2;
this.isSelectList.forEach(result => {
result.per = p1.toString();
result.per2 = p2.toString();
this.updateSetPrice(result);
});
},
//
async getVersionList(){
await versionList(this.queryParams).then(response => {
this.versionList = response.versionList;
this.redBookText = this.versionList[0].label;
this.form.rbDateUid = this.versionList[0].value
});
},
//
productList() {
productList().then(response => {
this.modelList = response;
});
},
removeItemFromIsSelectList(index) {
this.isSelectList.splice(index, 1);
this.isSelectNumber = this.isSelectList.length;
},
//
productXinghList(sid) {
this.params = { uid_0: sid };
productXinghList(this.params).then(response => {
this.xinghList = response;
this.showXinghList = this.xinghList.length > 0 ? true : false;
if(this.showXinghList) {
this.xhTitle = '型号'
this.activeNames = ['xingHao']; //
}
});
},
//
selXinghTag(item) {
this.resetPanels(2);
this.xhTitle = `型号 - ${item.name_0}`;
this.selectedXinghUid = item.uid_0; // uid
this.selectedXinghTag = item.name_0; //
this.judgeparent(item);
},
//
judgeparent(item) {
this.params = { uid_0: item.uid_0 };
judgeparent(this.params).then(response => {
if (response) {
this.productZlList(item.uid_0);
} else {
this.productYsxhListCheck(item.uid_0, item.name_0);
}
});
},
//
productZlList(sid) {
this.params = { uid_0: sid };
productZlList(this.params).then(response => {
this.zlList = response;
this.showZlList = this.zlList.length > 0 ? true : false;
if(this.showZlList) {
this.zlTitle = '子类'
this.activeNames = this.activeNames = ['ziLei']; //
}
});
},
//
infoClick() {
this.showPanel = true;
},
//
handleSearchClick() {
this.sliceResultData = [];
this.searchMethod = 'handleSearchClick';
if (this.queryParams.name_0 || this.queryParams.model) {
this.loadingLogo = true;
console.log('handleSerachClick loading:' + this.loading)
this.searchResultCurrentPage = 1,
this.searchResultPageSize = 10,
console.log('this.searchResultCurrentPage' + this.searchResultCurrentPage )
// this.queryParams.pageNum = 1;
// this.queryParams.pageSize = 8;
this.searchResultData = [],
handleSearchData(this.queryParams).then(response => {
console.log('handleSearchData:' + this.loading)
this.searchResultData = response;
this.searchResultTotal = this.searchResultData.length;
this.finished = this.sliceResultData.length >= this.searchResultTotal;
this.loadingLogo = false;
// this.searchResultCurrentPage = 1;
// this.searchResultLoading = false;
});
} else {
this.$message.warning("请输入查询条件!");
return;
}
},
//
productYsxhListCheck(sid, name) {
this.params = { uid_0: sid };
productYsxhListCheck(this.params).then(response => {
if (response) {
this.productYsxhList(sid, name);
} else {
this.selectedYsxhUid = sid;
this.selectedYsxhTag = name;
this.productJmListCheck(sid, name);
}
});
},
//
productYsxhList(sid, name) {
this.params = { uid_0: sid, name_0: name };
productYsxhList(this.params).then(response => {
this.ysxhList = response;
this.showYsxhList = this.ysxhList.length > 0 ? true : false;
if(this.showYsxhList) {
this.ysxhTitle = '衍生型号';
this.activeNames = this.activeNames = ['ySXingHao']; //
}
});
},
//
selZlTag(item) {
this.resetPanels(3);
this.zlTitle = `子类 - ${item.name_0}`;
this.selectedZlTag = item.name_0;
this.productYsxhListCheck(item.uid_0, item.name_0);
},
//
selYsxhTag(item) {
this.resetPanels(4);
this.ysxhTitle = `衍生型号 - ${item.name_0}`;
this.selectedYsxhUid = item.uid_0;
this.selectedYsxhTag = item.name_0;
this.productJmListCheck(item.uid_0, item.name_0);
},
//
productJmListCheck(sid, name) {
this.params = { uid_0: sid };
productJmListCheck(this.params).then(response => {
if (response) {
this.productJmList(sid, name);
} else {
this.selectedYsxhTag = this.selectedXinghTag;
this.searchData(this.selectedXinghUid);
}
});
},
//
productJmList(sid, name) {
this.params = { uid_0: sid, name_0: name };
productJmList(this.params).then(response => {
this.jmList = response;
this.showJmList = this.jmList.length > 0 ? true : false;
if(this.showJmList) {
this.jmTitle = '截面'
this.activeNames = this.activeNames = ['jieMian']; //
}
});
},
//
selJmTag(item) {
this.jmTitle = `截面 - ${item.section}`;
this.selectedJmTag = item.section;
this.searchResultCurrentPage = 1; //
this.searchResultPageSize = 10;
this.searchMethod = 'searchData';
this.finished = false;
this.searchResultData = [];
this.searchResultLoading = true;
this.searchData(this.selectedYsxhUid, item.section);
this.activeNames = this.activeNames = []; //
},
//
searchData(sid, section) {
this.sliceResultData = [];
this.params = { uid_0: sid, section: section, name_0: this.selectedYsxhTag };
searchData(this.params).then(response => {
this.searchResultData = response;
console.log(this.searchResultData)
this.searchResultTotal = this.searchResultData.length;
this.loading = false;
});
},
//
resetPanels(level) {
if (level <= 1) {
this.xhTitle = '';
this.showXinghList = false;
this.xinghList = [];
}
if (level <= 2) {
this.zlTitle = '';
this.showZlList = false;
this.zlList = [];
}
if (level <= 3) {
this.ysxhTitle = '';
this.showYsxhList = false;
this.ysxhList = [];
}
if (level <= 4) {
this.jmTitle = '';
this.showJmList = false;
this.jmList = [];
}
},
addItemToIsSelectList(item) {
const uid_0 = item.uid_0;
const name_0 = item.name_0;
const per = 0.8;
const per2 = 1;
const count = 1;
const numericPrice = parseFloat(item.price);
// setPrice
const setPrice = numericPrice * per * per2;
const allPrice = setPrice * 1;
this.isSelectList.push({
uid: uid_0.toString(),
name_0: name_0,
model: item.model,
voltage: item.voltage,
price: numericPrice,
spec: item.spec,
stu: item.stu,
per: per,
per2: per2,
count: count,
setPrice: setPrice,
allPrice: allPrice,
});
this.isSelectNumber = this.isSelectList.length;
},
onLoad() {
console.log('onLoad loading:' + this.loading)
this.finished = this.sliceResultData.length >= this.searchResultTotal;
this.searchResultCurrentPage++;
this.loading = false;
},
updateSetPrice(result) {
const numericPrice = parseFloat(result.price);
const per = parseFloat(result.per);
const per2 = parseFloat(result.per2);
const num = parseFloat(result.count);
result.setPrice = (numericPrice * per * per2).toFixed(2);
result.allPrice = (numericPrice * per * per2 * num).toFixed(2)
},
},
watch: {
isSelectList: {
handler(newList) {
newList.forEach((result) => {
this.$watch(() => result.per, () => {
this.updateSetPrice(result);
});
this.$watch(() => result.per2, () => {
this.updateSetPrice(result);
});
this.$watch(() => result.count, () => {
this.updateSetPrice(result);
});
});
},
deep: true,
},
},
}
</script>
<style>
.info-container {
display: flex;
justify-content: space-between;
}
.column {
flex: 1;
display: flex;
flex-direction: column;
}
.info-item {
font-size: 16px;
margin: 10px 20px 0px 0px;
}
.van-card__content {
min-height: 0px
}
.custom-card .van-card__content .van-card__desc {
margin-top: 15px; /* 根据需要调整间距 */
font-size: 15px; /* 根据需要调整字体大小 */
}
.custom-card .van-card__content .van-card__title {
margin-top: 5px;
font-size: 15px; /* 根据需要调整字体大小 */
}
.van-collapse-item__title {
text-align: center;
font-size: 18px;
}
.content-wrapper {
display: flex;
flex-wrap: wrap;
}
.content-item {
color: #00afff;
font-size: 14px; /* 设置内容字体大小 */
flex: 0 0 calc(50% - 10px); /* 两列布局,减去间距 */
box-sizing: border-box;
margin: 8px 5px 8px 5px; /* 目录面板内容的字体大小 */
text-align: center;
cursor: pointer;
}
.delete-button {
height: 100%;
}
.fullscreen-dialog .van-dialog__content {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: white;
position: fixed;
top: 0;
left: 0;
margin: 0;
border-radius: 0;
}
.dialog-content {
text-align: center;
}
</style>

View File

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "quots"
}
</script>
<style scoped>
</style>