Commit 1ab2b027 authored by 刘文虎's avatar 刘文虎

报价单

parent af9ea431
Pipeline #3954 canceled with stages
......@@ -10,6 +10,10 @@
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "remote"
},
"mp-weixin" :
{
"launchtype" : "local"
......
......@@ -3,6 +3,7 @@ export function getList(data) {
return request({
url: `/rest/repair/debtQuery`,
method: 'GET',
data
data,
noLoading:true
})
}
......@@ -189,3 +189,11 @@ export async function getProjectMembersKnow(data) {
})
}
export async function collectionMember(data) {
return request({
url: `/rest/repair/customer/collection`,
method: 'POST',
data,
noLoading: true
})
}
......@@ -191,8 +191,7 @@
"path": "quoted-price/create/price",
"style": {
"navigationBarTitleText": "服务报价",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"enablePullDownRefresh": false
}
}, {
......
......@@ -269,6 +269,7 @@ export default {
},
navigateTo() {
uni.$emit(this.notification, {});
uni.$emit("update-custom-edit") //修改时更新报价页面
this.$u.route({
type: 'back'
});
......
......@@ -77,7 +77,7 @@ export default {
if(options&&options.id){
this.id=options.id
this.getDetail()
// 监听某个服务分类或者服务价格删除
// 监听某个服务分类或者服务价格修改
uni.$on("update-custom-edit",()=>{
this.refreshParentPage()
})
......
<template>
<view class="list">
<NavbarRight backTextBold :backText="backText" />
<!-- <NavbarRight backTextBold :backText="backText" /> -->
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<block v-else>
<view class="item" v-for="(item, index) in list" :key="item.id" @click="clickCell(item)">
......@@ -95,7 +95,6 @@ export default {
}
});
uni.$once(this.notification, res => {
uni.$emit("update-custom-edit")
this.getList()
});
},
......
......@@ -53,6 +53,7 @@
<view class="collapse-body-bottom-add-icon">
<view class="mark-box" @click.stop.prevent="firstAdd(item2)" v-if="item2.num == 0 && item2.offerType === 'scope'"></view>
<number-box
:index="index"
theme-colors="#02A074"
inputHeight="40"
v-model="item2.num"
......
<template>
<u-popup v-model="show" border-radius="24" mode="bottom" @close="onClose">
<u-popup v-model="popupShow" border-radius="24" mode="bottom" @close="onClose">
<view class="content">
<view class="charge footer">
<view class="charge-title">
......@@ -57,19 +57,24 @@ export default {
data() {
return {
cartShow: true,
popupShow:false,
};
},
watch:{
show(val){
this.popupShow=val
}
},
methods: {
close() {
this.$emit('update:show',false)
},
onClose(){
this.$emit('update:show',false)
},
valChange(e, item) {
console.log('cart-popup,$event', e);
console.log('cart-popup, item', item);
// console.log('cart-popup,$event', e);
// console.log('cart-popup, item', item);
this.$set(item, 'num', e.value);
let list=[...this.list]
list.forEach((item, index) => {
......@@ -79,6 +84,7 @@ export default {
}
});
let params = {
item:item,
list: list,
deleted: null
};
......
......@@ -10,7 +10,7 @@
<view class="collapse-body-bottom-add">
<zb-tooltip placement="top-end" ref="tooltip1" color="#7f7f7f" :visible.sync="showTips">
<view class="collapse-body-bottom-add-icon" @click="add">
<number-box theme-colors="#02A074" inputHeight="40" v-model="form.num" disabled-input @change="valChange"></number-box>
<number-box :index="index" theme-colors="#02A074" inputHeight="40" v-model="num" disabled-input @change="valChange"></number-box>
</view>
<view class="tooltip" slot="content">
<text>点击可以加入计算器算出收费</text>
......@@ -42,21 +42,24 @@ export default {
showTips:{
type: Boolean,
default:false
}
},
index:{
type: String,
default:""
},
},
data() {
return {
form: {
num: 0
}
num: 0
};
},
watch: {
detail: {
handler(val, old) {
this.form.num = val.num || 0;
this.num = val.num || 0;
},
deep:true,
immediate: true
}
},
......@@ -66,14 +69,13 @@ export default {
this.$store.dispatch('Set_quoted_price_tooltip', true);
},
valChange(e) {
console.log("collapse-body-valChange",e);
this.form.num = e.value;
this.num = e.value;
this.add();
},
add() {
this.$emit('add', {
item: this.detail,
num: this.form.num,
num: this.num,
parentTitle:this.parentTitle
});
}
......
......@@ -40,7 +40,9 @@
</view>
</view>
<view v-if="item2.open">
<!-- :key="item3.classC" -->
<collapse-body
:index="`${index2}-${index3}`"
:detail="item3"
:parentTitle="item2.classBProject"
@add="addPrice"
......@@ -185,7 +187,7 @@ export default {
},
setCart(params) {
let { num, parentTitle } = params;
let item = this.deepClone(params.item);
let item = JSON.parse(JSON.stringify(params.item));
let flag = true;
this.shoppingCartList.forEach((target, index) => {
if (target.classC === item.classC) {
......@@ -215,7 +217,14 @@ export default {
}
},
cartPopupChange(params) {
let { list, deleted } = params;
let { list, deleted,item } = params;
this.mainData.children.forEach((data,mainIndex) => {
data.children.map((el,childrenIndex) => {
if (item.classC === el.classC) {
this.$set(el, 'num', item.num);
}
});
});
this.shoppingCartList = list;
this.resetCollapseBody(deleted);
},
......@@ -277,13 +286,15 @@ export default {
// 移除 "备件费"
newList.splice(newList.findIndex(item => item.classA === 'T12'), 1);
// 左侧列表赋值
this.leftArray = this.deepClone(newList);
// this.leftArray = this.deepClone(newList);
this.leftArray = JSON.parse(JSON.stringify(newList));
// 第二层
newList.map(el => {
el.id=el.classC
data.map((item, index) => {
if (item.classA === el.classA) {
let item1 = this.deepClone(item);
// let item1 = this.deepClone(item);
let item1 = JSON.parse(JSON.stringify(item));
item1.open = false;
if (!el.children) {
el.children = [item1];
......@@ -295,7 +306,8 @@ export default {
});
// 第二层去重
newList = newList.map(item => {
let arr = this.deepClone(item.children);
// let arr = this.deepClone(item.children);
let arr = JSON.parse(JSON.stringify(item.children));
item.children = this.uniqueFunc(arr, 'classB');
return item;
});
......@@ -304,12 +316,14 @@ export default {
el.children.map(el2 => {
data.map((item, index) => {
if (item.classB === el2.classB) {
let item1 = this.deepClone(item);
// let item1 = this.deepClone(item);
let item1 = JSON.parse(JSON.stringify(item));
item1.num = 0;
item1.id=item1.classC
if (!el2.children) {
el2.children = [item1];
el2.children = [{...item1}];
} else {
el2.children.push(item1);
el2.children.push({...item1});
}
}
});
......
......@@ -65,11 +65,11 @@
<view class="middle-image-view"><image :src="middleImage"></image></view>
<view class="money-view part-view">
<view class="shop-title">报价方</view>
<view class="shop-name">{{ shopInfo.name }}</view>
<view class="shop-address">{{ shopInfo.address }}</view>
<view class="shop-lister">
<text>{{ shopInfo.lister }}</text>
<text class="shop-phone">{{ shopInfo.phone }}</text>
<view class="shop-name">{{ shopInfo.name||'' }}</view>
<view class="shop-address">{{ shopInfo.address||'' }}</view>
<view class="shop-lister" v-if="shopInfo.lister||shopInfo.phone">
<text>{{ shopInfo.lister||"" }}</text>
<text class="shop-phone">{{ shopInfo.phone||"" }}</text>
</view>
</view>
<view class="middle-image-view"><image :src="middleImage"></image></view>
......
......@@ -98,6 +98,7 @@ export default {
});
},
clickCell(item) {
console.log("clickCell")
this.$store.dispatch('Save_custom_id', item.id);
let path = 'pages/bill/quoted-price/custom/custom';
if (item.systemFlag) {
......
......@@ -13,11 +13,29 @@
@custom="changeSearch" @search="changeSearch" :show-action="false"
:input-style="{ 'font-size': '26rpx', color: '#333333' }"></u-search>
</view>
<view class="tabs-box">
<u-tabs-swiper
ref="uTabs"
bg-color="#f6f7fa"
font-size="28"
bar-width="32"
bar-height="4"
height="60"
inactive-color="#8D8D8D"
active-color="#02A074"
name="title"
:list="tabs"
:current="tabCurrent"
@change="tabsChange"
:is-scroll="false"
swiperWidth="750"
></u-tabs-swiper>
</view>
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<view v-else>
<view class="bill-list">
<view v-for="(item, index) in list" :key="index" class="item-view">
<CellEmployee type="normal" :member="item" @selectCell="handleSelectCell" />
<CellEmployee type="normal" :member="item" @selectCell="handleSelectCell" @select="handleSelectMember" />
</view>
</view>
<view class="load-more-view" v-show="(current == 1 && loaded) || current > 1">
......@@ -40,8 +58,10 @@
baseUrl
} from '@/utils/config.js';
import {
getProjectMembersKnow
getProjectMembersKnow,
collectionMember
} from '@/api/maintain/index.js';
import { chooseMemberTabs } from '@/utils/options/maintain-bill/index.js';
export default {
components: {
NoData,
......@@ -49,7 +69,10 @@
},
data() {
return {
tabs: chooseMemberTabs,
tabCurrent:0,
list: [],
type:'',
keyword: '',
loaded: false,
current: 1,
......@@ -75,10 +98,44 @@
uni.$off("choose-member")
},
methods: {
tabsChange(e){
this.tabCurrent=e
this.changeSearch()
console.log('tabsChange', e);
},
handleSelectCell(item) {
uni.$emit("choose-member",item)
uni.navigateBack()
},
handleSelectMember (id, collection) {
for (var item of this.list) {
if (item.id == id) {
item.collection = collection
this.dealCollect({
id:id})
this.showToast(collection ? '收藏成功' : '取消成功')
break
}
}
},
dealCollect (params) {
collectionMember(params)
.then(res => {
let data = res.data;
if (data) {
}
})
.catch(err => {
for (var item of this.list) {
if (item.id == params.id) {
item.collection = !item.collection
break
}
}
console.log(err);
});
},
changeSearch() {
this.reloadList();
},
......@@ -98,6 +155,9 @@
size: this.size,
text: this.keyword,
};
if(this.tabCurrent==1){
params.collection=true
}
let res = await getProjectMembersKnow(params);
let {
records,
......@@ -185,6 +245,9 @@
.search-bar{
margin-bottom: 24rpx;
}
.tabs-box {
margin-bottom: 24rpx;
}
}
}
</style>
<template>
<view class="cell-employee">
<view class="content-view" :hover-class="isNormal ? 'u-hover-class' : ''" @click.stop="$u.throttle(handleCickCell, 500)">
<!-- :hover-class="isNormal ? 'u-hover-class' : ''" -->
<view class="content-view" @click="$u.throttle(handleCickCell, 500)">
<view class="left-view">
<view class="image-view">{{ imagekName }}</view>
<view class="name-view">{{ member.name }}</view>
<view :class="['info-view', {edit: isEdit}]">{{ textInfo }}</view>
</view>
<view class="right-view">
<text class="phone">
<!-- <text class="phone">
{{member.phone}}
</text>
</text> -->
<view class="unit-view">{{member.phone}}</view>
<view class="collectFlag-view" @click.stop="$u.throttle(handleSelect, 500)" hover-class="u-hover-class">
<image :src="collectImage" class="collectFlag-image"></image>
</view>
</view>
<!-- <view class="right-view" v-if="isSelect || isEdit">
<view v-if="isSelect" class="select-view" @click="$u.throttle(handleSelect, 500)" hover-class="u-hover-class">
......@@ -53,6 +58,9 @@ export default {
baseUrl () {
return process.uniEnv.qn_base_url
},
collectImage () {
return this.baseUrl + (this.member.collection ? 'dianjishoucang1@3x.png' : 'shoucangshoufei0@3x.png')
},
imagekName () {
var length = (this.member.name || '').length
return (this.member.name || '').substring(length - 2)
......@@ -81,8 +89,8 @@ export default {
this.$emit('action', this.member.id)
},
handleSelect () {
this.member.selected = !this.member.selected
this.$emit('select', this.member.id, this.member.selected)
this.member.collection = !this.member.collection
this.$emit('select', this.member.id, this.member.collection)
},
handleCickCell() {
if (this.isNormal) {
......@@ -149,20 +157,19 @@ export default {
padding-right: 24rpx;
font-weight: bold;
}
.select-view {
width: 80rpx;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
.select-icon {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
border: 2rpx solid #cccccc;
}
}
.collectFlag-view {
margin-left: 56rpx;
width: 80rpx;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
.collectFlag-image {
width: 32rpx;
height: 32rpx;
}
}
}
.edit-view {
......
<template>
<u-popup v-model="show" :animation="false" ref="uniPopup" border-radius="24" type="center" mode="center">
<view class="custom-popup">
<view class="apply-refuse">
<view class="title">本次服务收费金额</view>
<view class="content-view">
</view>
<view class="btn">
<view class="confirm" hover-class="u-hover-class" @click="$u.throttle(handleClickSure, 500)">确定</view>
</view>
</view>
<u-toast ref="uToast" />
</view>
</u-popup>
</template>
<script>
export default {
props:['qrcode'],
data() {
return {
show: false,
};
},
methods: {
open() {
this.show = true;
},
close() {
this.show = false;
},
handleClickSure() {
this.close();
this.$emit('confirm', this.text);
},
}
};
</script>
<style lang="scss" scoped>
.custom-popup {
.apply-refuse {
background: linear-gradient(180deg, #f4fffc 0%, #ffffff 50%) #fff;
width: 622rpx;
border-radius: 12rpx;
padding: 0 24rpx 32rpx;
.title {
padding: 48rpx 0 40rpx;
text-align: center;
font-size: 32rpx;
color: #333333;
}
.content-view {
width: 100%;
}
.btn {
margin-top: 68rpx;
font-size: 32rpx;
.confirm {
height: 96rpx;
font-weight: bold;
background: $default-color;
border-radius: 16rpx;
line-height: 96rpx;
text-align: center;
margin-left: 30rpx;
color: #ffffff;
}
}
}
}
.none {
display: none;
}
</style>
<template>
<view class="share-view">
<NavbarRight title="邀请有奖" />
<view class="content-view">
<!-- #ifdef APP-PLUS -->
<scroll-view scroll-y="true" style="height:100%;position: relative;">
<!-- #endif -->
<view class="image-view">
<image mode="widthFix" :src="backgroundImage"></image>
</view>
<!-- #ifdef APP-PLUS -->
</scroll-view>
<!-- #endif -->
<view class="info-view">
<view class="head-image">
<image :src="userInfo.avatar"></image>
</view>
<view>{{userInfo.nickname}}</view>
</view>
</view>
<view class="bottom-view">
<u-button type="success" open-type="share" :custom-style="customShare" @click="handleClickShare">
<view class="bottom-content">
<view class="icon-view">
<image :src="shareIcon"></image>
</view>
<view class="share-view">分享邀请</view>
</view>
</u-button>
</view>
</view>
<view class="share-view">
<NavbarRight title="邀请有奖" />
<view class="content-view">
<!-- #ifdef APP-PLUS -->
<scroll-view scroll-y="true" style="height:100%;position: relative;">
<!-- #endif -->
<view class="image-view"><image mode="widthFix" :src="backgroundImage"></image></view>
<!-- #ifdef APP-PLUS -->
</scroll-view>
<!-- #endif -->
<view class="info-view">
<view class="head-image"><image :src="userInfo.avatar"></image></view>
<view>{{ userInfo.nickname }}</view>
</view>
</view>
<view class="bottom-view">
<u-button type="success" open-type="share" :custom-style="customSave" @click="handleClickSave">
<view class="bottom-content">
<view class="icon-view"><image :src="shareIcon"></image></view>
<view class="share-view">生成海报</view>
</view>
</u-button>
<u-button type="success" open-type="share" :custom-style="customShare" @click="handleClickShare">
<view class="bottom-content">
<view class="icon-view"><image :src="shareIcon"></image></view>
<view class="share-view">分享邀请</view>
</view>
</u-button>
</view>
<save-poster-popup ref="save-poster-popup" :qrcode="qrcode"></save-poster-popup>
</view>
</template>
<script>
import NavbarRight from '@/components/navbar-right';
import SavePosterPopup from './components/save-poster-popup.vue';
import { mapGetters } from 'vuex';
import { wxMiniId, webUrl } from '@/utils/config.js';
import { shareInvited } from '@/api/mine/share.js';
export default {
components: {
NavbarRight,
},
data () {
return {
};
},
computed: {
...mapGetters(['userInfo']),
baseUrl () {
return process.uniEnv.qn_base_url;
},
backgroundImage () {
return this.baseUrl + 'yaoqinghuodong.jpg'
},
shareImage () {
return this.baseUrl + 'yaoqinghuodongfenxiang.jpg'
},
shareIcon () {
return this.baseUrl + 'fenxiangicon@3x.png'
},
customShare () {
return {
color: 'transparent',
'background-color': 'transparent',
height: '104rpx',
'border-radius': '52rpx',
width: '652rpx',
padding: '0rpx'
};
}
},
onLoad (options) {
},
onUnload () {
},
methods: {
shareInvited () {
shareInvited({})
.then(res => {
if (res.data) {
}
})
.catch(err => {
console.log(err);
});
},
handleClickShare () {
// #ifdef APP-PLUS
this.shareInvited()
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 5,
href: webUrl,
imageUrl: this.shareImage,
title: '扳手记账',
miniProgram: {
id: wxMiniId,
path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
type: 0,
webUrl: webUrl
},
success: ret => {
console.log(JSON.stringify(ret));
block();
},
fail: function (err) {
console.log('fail:' + JSON.stringify(err));
}
});
// #endif
},
// 朋友圈
onShareTimeline (res) {
this.shareInvited()
return {
title: '扳手记账',
path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
imageUrl: this.shareImage
};
},
// 好友
onShareAppMessage (res) {
this.shareInvited()
return {
title: '扳手记账',
path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
imageUrl: this.shareImage
};
}
}
components: {
NavbarRight,
SavePosterPopup
},
data() {
return {
qrcode:'',
};
},
computed: {
...mapGetters(['userInfo']),
baseUrl() {
return process.uniEnv.qn_base_url;
},
backgroundImage() {
return this.baseUrl + 'yaoqinghuodong.jpg';
},
shareImage() {
return this.baseUrl + 'yaoqinghuodongfenxiang.jpg';
},
shareIcon() {
return this.baseUrl + 'fenxiangicon@3x.png';
},
customShare() {
return {
color: 'transparent',
'background-color': 'transparent',
height: '104rpx',
'border-radius': '52rpx',
width: '314rpx',
padding: '0rpx'
};
},
customSave() {
return {
color: 'transparent',
'background-color': 'transparent',
height: '104rpx',
'border-radius': '52rpx',
width: '314rpx',
padding: '0rpx'
};
},
},
onLoad(options) {},
onUnload() {},
methods: {
handleClickSave(){
this.$refs['save-poster-popup'].open()
},
shareInvited() {
shareInvited({})
.then(res => {
if (res.data) {
}
})
.catch(err => {
console.log(err);
});
},
handleClickShare() {
// #ifdef APP-PLUS
this.shareInvited();
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 5,
href: webUrl,
imageUrl: this.shareImage,
title: '扳手记账',
miniProgram: {
id: wxMiniId,
path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
type: 0,
webUrl: webUrl
},
success: ret => {
console.log(JSON.stringify(ret));
block();
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
}
});
// #endif
},
// 朋友圈
onShareTimeline(res) {
this.shareInvited();
return {
title: '扳手记账',
path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
imageUrl: this.shareImage
};
},
// 好友
onShareAppMessage(res) {
this.shareInvited();
return {
title: '扳手记账',
path: `/pages/index/index?shareUserId=${this.userInfo.id}`,
imageUrl: this.shareImage
};
}
}
};
</script>
<style scoped lang="scss">
.share-view {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
.content-view {
height: 100%;
overflow: auto;
position: relative;
.image-view {
width: 100%;
position: relative;
}
.info-view {
position: absolute;
font-size: 28rpx;
color: #ffffff;
font-weight: bold;
top: 36rpx;
right: 0;
left: 28rpx;
display: flex;
align-items: center;
.head-image {
width: 56rpx;
height: 56rpx;
border-radius: 50%;
margin-right: 12rpx;
overflow: hidden;
border: 2rpx solid #ffffff;
background: #f6f7fa;
}
}
}
.bottom-view {
margin: 16rpx 24rpx 36rpx 24rpx;
display: flex;
align-items: center;
justify-content: center;
// background-color: #ffffff;
.bottom-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-image: linear-gradient(to bottom, #FF8A20 0%, #EB172C 100%);
overflow: hidden;
border-radius: 52rpx;
.icon-view {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
display: flex;
justify-content: center;
align-items: center;
}
.share-view {
color: #ffffff;
font-weight: bold;
font-size: 32rpx;
margin-left: 8rpx;
background-color: transparent;
height: 100%;
line-height: 104rpx;
}
}
}
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
.content-view {
height: 100%;
overflow: auto;
position: relative;
.image-view {
width: 100%;
position: relative;
}
.info-view {
position: absolute;
font-size: 28rpx;
color: #ffffff;
font-weight: bold;
top: 36rpx;
right: 0;
left: 28rpx;
display: flex;
align-items: center;
.head-image {
width: 56rpx;
height: 56rpx;
border-radius: 50%;
margin-right: 12rpx;
overflow: hidden;
border: 2rpx solid #ffffff;
background: #f6f7fa;
}
}
}
.bottom-view {
margin: 16rpx 24rpx 36rpx 24rpx;
display: flex;
align-items: center;
justify-content: center;
// background-color: #ffffff;
.bottom-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-image: linear-gradient(to bottom, #ff8a20 0%, #eb172c 100%);
overflow: hidden;
border-radius: 52rpx;
.icon-view {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
display: flex;
justify-content: center;
align-items: center;
}
.share-view {
color: #ffffff;
font-weight: bold;
font-size: 32rpx;
margin-left: 8rpx;
background-color: transparent;
height: 100%;
line-height: 104rpx;
}
}
}
}
</style>
......@@ -253,3 +253,15 @@ export const tableFooterOptions = [{
},
]
export const chooseMemberTabs = [{
title: '最近',
name: ''
},
{
title: '收藏',
name: 'collection'
},
]
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