提交 de92eb27 authored 作者: 刘旭's avatar 刘旭

更新需求

上级 f52e0c11
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
} }
const close = () => { const close = () => {
keyword.value = ''
emits('update:modelValue', false) emits('update:modelValue', false)
} }
</script> </script>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
下载pdf 下载pdf
</u-button> </u-button>
</view> </view>
<text class="quotation-details" @tap="show = true">报价详情</text> <text class="quotation-details" @tap="quotationDetail">报价详情</text>
</view> </view>
<view <view
style="display: flex; justify-content: space-between; margin-top: 20rpx" style="display: flex; justify-content: space-between; margin-top: 20rpx"
...@@ -59,13 +59,8 @@ ...@@ -59,13 +59,8 @@
<view style="margin-bottom: 10rpx"> <view style="margin-bottom: 10rpx">
单价:¥{{ Number(item.price).toFixed(2) }} 单价:¥{{ Number(item.price).toFixed(2) }}
</view> </view>
<!-- <view style="margin-bottom: 10rpx;">
当前金额:¥{{ item.totalPrice.toFixed(2) }}
</view> -->
<view>当前含税金额:¥{{ item.totalPriceTex.toFixed(2) }}</view> <view>当前含税金额:¥{{ item.totalPriceTex.toFixed(2) }}</view>
</view> </view>
<!-- <u-number-box v-model="item.number" :input-width="60" :input-height="30" :min="1" :index="index"
@change="valChange"></u-number-box> -->
</view> </view>
<view style="margin-bottom: 10rpx"> <view style="margin-bottom: 10rpx">
商品详情:{{ item.remarks === '[]' ? '无' : item.remarks }} 商品详情:{{ item.remarks === '[]' ? '无' : item.remarks }}
...@@ -74,46 +69,100 @@ ...@@ -74,46 +69,100 @@
</view> </view>
</view> </view>
</view> </view>
<u-popup v-model="show" mode="center" closeable width="80%" height="70%">
<u-modal
v-model="showModel"
:content="content"
@confirm="modelConfirm"
@cancel="modelCancel"
showCancelButton
>
</u-modal>
<u-select
v-model="guaranteeShow"
:list="guaranteeList"
@confirm="textValue($event, 'guarantee')"
/>
<u-popup
v-model="show"
mode="center"
closeable
border-radius="15"
width="90%"
height="70%"
@close="close"
>
<h3 style="padding: 30rpx; text-align: center">报价详情</h3> <h3 style="padding: 30rpx; text-align: center">报价详情</h3>
<u-cell-group> <u-cell-group>
<block v-for="(item, index) in quotationList" :key="index"> <block v-for="(item, index) in quotationList" :key="index">
<u-cell-item <u-cell-item
icon="" :icon="editFields.indexOf(item.type) !== -1 ? 'edit-pen' : ''"
:title="item.title" :title="item.title"
:value="item.value" :value="item.type !== 'deliveryTime' ? item.value : ''"
:arrow="false" :arrow="false"
></u-cell-item> @tap="tapCellItem(item.type)"
>
<template #right-icon>
<u-input
v-if="item.type === 'deliveryTime'"
v-model="item.value"
placeholder=""
clearable
/>
</template>
</u-cell-item>
</block> </block>
</u-cell-group> </u-cell-group>
<view style="display: flex; padding: 30rpx 0">
<u-button type="primary" @tap="save">保存</u-button>
</view>
</u-popup> </u-popup>
<u-modal <searchPopup
v-model="showModel" v-model="searchShow"
:content="content" :type="type"
@confirm="modelConfirm" :list="searchList"
@cancel="modelCancel" @search="search"
showCancelButton @textValue="textValue"
> />
</u-modal>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onLoad, onBackPress } from '@dcloudio/uni-app' import { onLoad, onBackPress } from '@dcloudio/uni-app'
import { ref, computed, nextTick } from 'vue' import { ref, computed, nextTick } from 'vue'
import { quotationInitAgain, fillQuotation } from '@/api/cart' import {
quotationInitAgain,
fillQuotation,
getQuotationDelivery,
getQuotationPayment,
} from '@/api/cart'
import { getTax } from '@/api/index' import { getTax } from '@/api/index'
import config from '@/utils/config' import config from '@/utils/config'
import searchPopup from '@/components/searchPupop.vue'
let baseUrl = config.baseUrl let baseUrl = config.baseUrl
let orderId = ref() let orderId = ref()
let quotationData = ref() let quotationData = ref()
let quotationList = ref() let quotationList = ref()
let quotationListCopy: any = ''
let quotationDataCopy: any = ''
let tax = ref() let tax = ref()
let content = ref('确认重新报价?') let content = ref('确认重新报价?')
let show = ref(false) let show = ref(false)
let searchShow = ref(false)
let guaranteeShow = ref(false)
let isSave = ref(false)
let type = ref()
let showModel = ref(false) let showModel = ref(false)
let oldPrice = ref() let oldPrice = ref()
let searchList = ref()
let editFields = ['pay', 'guarantee', 'deliveryTime', 'deliveryAddr']
let guaranteeList = ref([
{ value: '1年', label: '1年' },
{ value: '2年', label: '2年' },
{ value: '其他', label: '其他' },
])
onLoad((options: any) => { onLoad((options: any) => {
orderId.value = options.orderId orderId.value = options.orderId
...@@ -215,31 +264,124 @@ ...@@ -215,31 +264,124 @@
}) })
} }
const tapCellItem = (item: any) => {
console.log(item)
switch (item) {
case 'deliveryAddr':
initQuotationDelivery()
type.value = 'deliveryAddr'
searchShow.value = true
break
case 'pay':
initQuotationPayment()
type.value = 'pay'
searchShow.value = true
break
case 'guarantee':
guaranteeShow.value = true
break
default:
// initQuotationBank(val)
break
}
}
const search = (val: string, type: string) => {
switch (type) {
case 'deliveryAddr':
initQuotationDelivery(val)
break
case 'pay':
initQuotationPayment(val)
break
}
}
const textValue = (val: any, type: string) => {
console.log(val, type)
switch (type) {
case 'deliveryAddr':
quotationDataCopy.deliveryAddr = val.textValue
quotationList.value.filter((item: any) => item.type == type)[0].value =
val.textValue
break
case 'pay':
quotationDataCopy.pay = val.textValue
quotationList.value.filter((item: any) => item.type == type)[0].value =
val.textValue
break
case 'guarantee':
quotationDataCopy.guarantee = val[0].value
quotationList.value.filter((item: any) => item.type == type)[0].value =
val[0].value
break
default:
break
}
}
const close = (e: any) => {
if (isSave.value) return
quotationList.value = quotationListCopy
}
let quotationDetail = () => {
show.value = true
isSave.value = false
quotationListCopy = JSON.parse(JSON.stringify(quotationList.value))
quotationDataCopy = JSON.parse(JSON.stringify(quotationData.value.quotation))
}
let save = () => {
quotationData.value.quotation = quotationDataCopy
isSave.value = true
show.value = false
}
let init = () => { let init = () => {
quotationInitAgain({ orderId: orderId.value }).then((res: any) => { quotationInitAgain({ orderId: orderId.value }).then((res: any) => {
if (res.data.code === 200) { if (res.data.code === 200) {
quotationData.value = res.data.data quotationData.value = res.data.data
let data = quotationData.value.quotation let data = quotationData.value.quotation
quotationList.value = [ quotationList.value = [
{ title: '发货人', value: data.attend }, { title: '发货人', value: data.attend, type: 'attend' },
{ title: '发货联系电话', value: data.tel }, { title: '发货联系电话', value: data.tel, type: 'tel' },
{ title: '发货email', value: data.email }, { title: '发货email', value: data.email, type: 'email' },
{ title: '发货地址', value: data.addr }, { title: '发货地址', value: data.addr, type: 'addr' },
{ title: '收货公司名称', value: data.toCust }, { title: '收货公司名称', value: data.toCust, type: 'toCust' },
{ title: '收货人', value: data.quotationAttend }, { title: '收货人', value: data.quotationAttend, type: 'quotationAttend' },
{ title: '收货email', value: data.quotationEmail }, { title: '收货email', value: data.quotationEmail, type: 'quotationEmail' },
{ title: '收货联系电话', value: data.quotationTel }, { title: '收货联系电话', value: data.quotationTel, type: 'quotationTel' },
{ title: '交货日期', value: data.deliveryDate }, { title: '订单号', value: data.noOrder, type: 'noOrder' },
{ title: '收货地址', value: data.deliveryAddr }, { title: '预计交货时间', value: data.deliveryDate, type: 'deliveryDate' },
{ title: '订单号', value: data.noOrder }, { title: '交货期', value: data.deliveryTime, type: 'deliveryTime' },
{ title: '付款方式', value: data.pay }, { title: '交货地址', value: data.deliveryAddr, type: 'deliveryAddr' },
{ title: '保修', value: data.guarantee }, { title: '付款方式', value: data.pay, type: 'pay' },
{ title: '备注', value: data.remarks }, { title: '保修', value: data.guarantee, type: 'guarantee' },
{ title: '备注', value: data.remarks, type: 'remarks' },
] ]
} }
}) })
} }
// 交货地址
let initQuotationDelivery = (name?: string) => {
getQuotationDelivery(name).then((res: any) => {
if (res.data.code === 200) {
searchList.value = res.data.data
}
})
}
// 收款条件
let initQuotationPayment = (name?: string) => {
getQuotationPayment(name).then((res: any) => {
if (res.data.code === 200) {
searchList.value = res.data.data
}
})
}
onBackPress((options: any) => { onBackPress((options: any) => {
const pages = getCurrentPages() // 当前页面路由 const pages = getCurrentPages() // 当前页面路由
const currentPageIndex = pages.length - 1 const currentPageIndex = pages.length - 1
...@@ -295,4 +437,13 @@ ...@@ -295,4 +437,13 @@
font-size: 0.875rem; font-size: 0.875rem;
color: rgb(192, 196, 204); color: rgb(192, 196, 204);
} }
:deep(.u-cell_right .uni-input-input) {
text-align: end;
color: #909399;
}
:deep(.u-select .u-drawer) {
z-index: 10099 !important;
}
</style> </style>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="address" @tap="tapAddresss"> <view class="address" @tap="tapAddresss">
<view class="top"> <view class="top">
<text>收货信息</text> <text>客户报价商务信息</text>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
<view class="bottom"> <view class="bottom">
......
...@@ -3,21 +3,40 @@ ...@@ -3,21 +3,40 @@
<view class="top"> <view class="top">
<view class="item"> <view class="item">
<view class="left">客户名称</view> <view class="left">客户名称</view>
<u-select v-model="showSelect" :list="selectList" @confirm="onConfirm"></u-select> <input
<input :disabled="true" v-model="addressData.name" placeholder-class="line" placeholder="请填写客户名称" :disabled="true"
@tap="showSelect = true" /> v-model="addressData.name"
placeholder-class="line"
placeholder="请填写客户名称"
@tap="searchShow = true"
/>
</view> </view>
<view class="item"> <view class="item">
<view class="left">采购员</view> <view class="left">采购员</view>
<input type="text" v-model="addressData.contactName" placeholder-class="line" placeholder="请填写采购员" /> <input
type="text"
v-model="addressData.contactName"
placeholder-class="line"
placeholder="请填写采购员"
/>
</view> </view>
<view class="item"> <view class="item">
<view class="left">采购手机号</view> <view class="left">采购手机号</view>
<input v-model="addressData.tel" type="text" placeholder-class="line" placeholder="请填写采购手机号" /> <input
v-model="addressData.tel"
type="text"
placeholder-class="line"
placeholder="请填写采购手机号"
/>
</view> </view>
<view class="item"> <view class="item">
<view class="left">采购邮箱</view> <view class="left">采购邮箱</view>
<input v-model="addressData.customerEmail" type="text" placeholder-class="line" placeholder="请填写采购邮箱" /> <input
v-model="addressData.customerEmail"
type="text"
placeholder-class="line"
placeholder="请填写采购邮箱"
/>
</view> </view>
<!-- <view class="item" @tap="showRegionPicker"> <!-- <view class="item" @tap="showRegionPicker">
<view class="left">所在地址</view> <view class="left">所在地址</view>
...@@ -25,8 +44,12 @@ ...@@ -25,8 +44,12 @@
</view> --> </view> -->
<view class="item address"> <view class="item address">
<view class="left">公司所在地址</view> <view class="left">公司所在地址</view>
<textarea v-model="addressData.addressDetail" type="text" placeholder-class="line" <textarea
placeholder="街道、楼牌等" /> v-model="addressData.addressDetail"
type="text"
placeholder-class="line"
placeholder="街道、楼牌等"
/>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
...@@ -41,30 +64,47 @@ ...@@ -41,30 +64,47 @@
</view> </view>
</view> </view>
<view style="padding: 6%;"> <view style="padding: 6%">
<u-button type="error" shape="circle" @click="addressSave">保存</u-button> <u-button type="error" shape="circle" @click="addressSave">保存</u-button>
<u-button v-show="editId" shape="circle" @click="addressDel" style="margin-top: 20rpx;"> <u-button
v-show="editId"
shape="circle"
@click="addressDel"
style="margin-top: 20rpx"
>
删除 删除
</u-button> </u-button>
</view> </view>
<u-picker mode="region" ref="uPicker" v-model="show" @confirm="confirm" /> <u-picker mode="region" ref="uPicker" v-model="show" @confirm="confirm" />
<u-modal v-model="showModel" :content="content" show-cancel-button @confirm="confirmModel"></u-modal> <u-modal
v-model="showModel"
:content="content"
show-cancel-button
@confirm="confirmModel"
></u-modal>
<searchPupop
v-model="searchShow"
:list="searchList"
@search="search"
@textValue="textValue"
/>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue'; import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app'
import { deleteAddress, saveAddress, getAddrList } from '@/api/index'; import { deleteAddress, saveAddress, getAddrList } from '@/api/index'
import { consigneeList } from '@/api/profile'; import { consigneeList } from '@/api/profile'
import searchPupop from '@/components/searchPupop.vue'
let show = ref(false);
let showModel = ref(false); let show = ref(false)
let showSelect = ref(false); let showModel = ref(false)
let content = ref('确认删除地址?'); let searchShow = ref(false)
let selectList = ref([] as any) let searchList = ref()
let addressData = ref({ let content = ref('确认删除地址?')
let addressData = ref({
addressDetail: '', addressDetail: '',
areaCode: '', areaCode: '',
city: '', city: '',
...@@ -78,55 +118,59 @@ let addressData = ref({ ...@@ -78,55 +118,59 @@ let addressData = ref({
postalCode: '', postalCode: '',
province: '', province: '',
tel: '', tel: '',
} as any); } as any)
// 显示地区 // 显示地区
let addressDetails = computed(() => { let addressDetails = computed(() => {
return addressData.value.province + addressData.value.city + addressData.value.county; return (
}); addressData.value.province +
addressData.value.city +
addressData.value.county
)
})
let editId = ref() let editId = ref()
onLoad((options?: any) => { onLoad((options?: any) => {
if (JSON.stringify(options) !== '{}') { if (JSON.stringify(options) !== '{}') {
addressData.value = JSON.parse(options.data); addressData.value = JSON.parse(options.data)
// 判断是否显示删除 // 判断是否显示删除
editId.value = addressData.value?.id editId.value = addressData.value?.id
} }
consigneeList().then((res: any) => { initConsigneeList()
if (res.data.code === 200) {
res.data.data.map((item: any) => {
selectList.value.push({
label: item.customerName,
value: item.customerCode
})
}) })
}
})
});
// 打开地区选择 // 打开地区选择
let showRegionPicker = async () => { let showRegionPicker = async () => {
const { data: res }: any = await getAddrList() const { data: res }: any = await getAddrList()
console.log(res); console.log(res)
show.value = true
}
show.value = true; let search = (val: string) => {
}; initConsigneeList(val)
}
let textValue = (val: any) => {
addressData.value.name = val.customerName
addressData.value.customerCode = val.customerCode
}
let onConfirm = (data: any) => { let onConfirm = (data: any) => {
addressData.value.name = data[0].label addressData.value.name = data[0].label
addressData.value.customerCode = data[0].value addressData.value.customerCode = data[0].value
} }
// 设置地区 // 设置地区
let confirm = (data: any) => { let confirm = (data: any) => {
addressData.value.areaCode = data.area.code; addressData.value.areaCode = data.area.code
addressData.value.province = data.province.name; addressData.value.province = data.province.name
addressData.value.city = data.city.name; addressData.value.city = data.city.name
addressData.value.county = data.area.name; addressData.value.county = data.area.name
}; }
// 确认删除地址 // 确认删除地址
let confirmModel = () => { let confirmModel = () => {
deleteAddress(editId.value).then((res: any) => { deleteAddress(editId.value).then((res: any) => {
if (res.data.code === 200) { if (res.data.code === 200) {
uni.navigateBack({ uni.navigateBack({
...@@ -135,38 +179,39 @@ let confirmModel = () => { ...@@ -135,38 +179,39 @@ let confirmModel = () => {
uni.$emit('initAddress') uni.$emit('initAddress')
uni.showToast({ uni.showToast({
title: '删除地址成功', title: '删除地址成功',
icon: 'none' icon: 'none',
})
},
}) })
} }
}); })
} }
});
}
// 保存地址 // 保存地址
let addressSave = () => { let addressSave = () => {
if (!addressData.value.name) if (!addressData.value.name)
return uni.showToast({ return uni.showToast({
title: '请输入客户名称', title: '请输入客户名称',
icon: 'none', icon: 'none',
}); })
if (!addressData.value.contactName) if (!addressData.value.contactName)
return uni.showToast({ return uni.showToast({
title: '请输入采购员', title: '请输入采购员',
icon: 'none', icon: 'none',
}); })
// let emailReg = /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/ // let emailReg = /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/
// if (!emailReg.test(addressData.value.customerEmail)) // if (!emailReg.test(addressData.value.customerEmail))
// return uni.showToast({ // return uni.showToast({
// title: '邮箱为空或格式不对', // title: '邮箱为空或格式不对',
// icon: 'none', // icon: 'none',
// }); // });
let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; let reg =
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (!reg.test(addressData.value.tel)) if (!reg.test(addressData.value.tel))
return uni.showToast({ return uni.showToast({
title: '电话号码为空或格式不对', title: '电话号码为空或格式不对',
icon: 'none', icon: 'none',
}); })
// if (!addressData.value.province) // if (!addressData.value.province)
// return uni.showToast({ // return uni.showToast({
// title: '请选择地址', // title: '请选择地址',
...@@ -183,25 +228,36 @@ let addressSave = () => { ...@@ -183,25 +228,36 @@ let addressSave = () => {
delta: 1, delta: 1,
success() { success() {
uni.$emit('initAddress') uni.$emit('initAddress')
},
})
} }
}); })
} }
});
};
// 打开删除地址模态框 // 打开删除地址模态框
let addressDel = () => { let addressDel = () => {
showModel.value = true showModel.value = true
}; }
let initConsigneeList = (name?: string) => {
consigneeList({ name }).then((res: any) => {
if (res.data.code === 200) {
res.data.data.map((item: any) => {
item.textValue = item.customerName
})
searchList.value = res.data.data
}
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .line { ::v-deep .line {
color: $u-light-color; color: $u-light-color;
font-size: 28rpx; font-size: 28rpx;
} }
.wrap { .wrap {
background-color: #f2f2f2; background-color: #f2f2f2;
.top { .top {
...@@ -315,8 +371,9 @@ let addressDel = () => { ...@@ -315,8 +371,9 @@ let addressDel = () => {
font-size: 24rpx; font-size: 24rpx;
} }
.right {} .right {
}
}
} }
} }
}
</style> </style>
...@@ -2,8 +2,8 @@ const CONFIG: any = { ...@@ -2,8 +2,8 @@ const CONFIG: any = {
// 开发环境配置 // 开发环境配置
development: { development: {
assetsPath: 'http://192.168.1.158:81', // 静态资源路径 assetsPath: 'http://192.168.1.158:81', // 静态资源路径
// baseUrl: 'http://192.168.1.158:81', // 后台接口请求地址 baseUrl: 'http://192.168.1.158:81', // 后台接口请求地址
baseUrl: 'http://192.168.1.27:8089', // 后台接口请求地址 // baseUrl: 'http://192.168.1.27:8089', // 后台接口请求地址
hostUrl: 'http://192.168.1.158:81', // H5地址(前端运行地址) hostUrl: 'http://192.168.1.158:81', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
}, },
......
import { defineConfig } from "vite"; import { defineConfig } from 'vite'
import uni from "@dcloudio/vite-plugin-uni"; import uni from '@dcloudio/vite-plugin-uni'
// import pxtovw from 'postcss-px-to-viewport' // import pxtovw from 'postcss-px-to-viewport'
import { resolve } from 'path'; import { resolve } from 'path'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],
resolve: { resolve: {
alias: { alias: {
'@': resolve(__dirname, './src') '@': resolve(__dirname, './src'),
} },
}, },
css: { css: {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
additionalData: `@import "@/uni.scss";` additionalData: `@import "@/uni.scss";`,
}, },
}, },
postcss: { postcss: {
// plugins: [loder_pxtovw] // plugins: [loder_pxtovw]
} },
}, },
assetsInclude: '@dcloudio/uni-ui', assetsInclude: '@dcloudio/uni-ui',
build: { build: {
...@@ -29,4 +29,4 @@ export default defineConfig({ ...@@ -29,4 +29,4 @@ export default defineConfig({
}, },
}, },
}, },
}); })
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论