邓雄飞 4 years ago
parent
commit
b1328aa523
13 changed files with 1043 additions and 528 deletions
  1. 24
      apis/setting.js
  2. 1
      pages/about/index.vue
  3. 180
      pages/account-management/index.vue
  4. 262
      pages/add-account/index.vue
  5. 66
      pages/add-paper/index.vue
  6. 18
      pages/mall/index.vue
  7. 2
      pages/mine/index.vue
  8. 37
      pages/quotation-details/index.vue
  9. 173
      pages/setting/index.vue
  10. 11
      pages/submit-quotation/index.vue
  11. 572
      pages/trade/quotationList.vue
  12. 4
      pages/user-info/index.vue
  13. 221
      utils/index.js

24
apis/setting.js

@ -6,3 +6,27 @@ export function employeeName(data) {
data
})
}
// 新增员工
export function addEmployee(data) {
return http.post({
url: '/yyt-uec/enterprise/add/employee?userId='+data.userId +'&enterpriseId=' +data.enterpriseId,
data
})
}
// 员工列表
export function employeeList(data) {
return http.get({
url: '/yyt-uec/enterprise/get/employee-list',
data
})
}
// 删除员工
export function deleteEmployee(data) {
return http.post({
url: '/yyt-uec/enterprise/delete/employee?enterpriseId='+data.enterpriseId,
data
})
}

1
pages/about/index.vue

@ -51,6 +51,7 @@ export default {
font-size: 64rpx;
color: #000000;
font-weight: 400;
margin-top: 40rpx;
}
.about-subtext {
font-size: 28rpx;

180
pages/account-management/index.vue

@ -7,26 +7,137 @@
<view slot="right" class="add-account" @click="addAccount">添加账号</view>
</uni-nav-bar>
</view>
<view class="">
<scroll-list style="touch-action: none" ref="orderRef" :option="orderOption" @load="orderUp" @refresh="orderDown">
<view class="account-list" v-for="(item,index) in list" :key="index">
<view class="account-iamge-width"><image class="list-image" src="../../static/imgs/client-credit-list/client-default.png" mode=""></image></view>
<view class="account-text">
<view class="account-name"><text>{{item.name}}-{{item.title}}</text></view>
<view class="account-phone"><text>{{item.mobile}}</text></view>
</view>
<view class="account-delete" @click="deleteAccount(item)"><text>删除账号</text></view>
</view>
</scroll-list>
</view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog type="info" mode="base" title="确认删除该账号?" :duration="2000" :before-close="true" @close="close" @confirm="confirm">
<view class="account-dialog-text">
<text>账号删除后无法在使用系统请谨慎操作</text>
</view>
</uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
export default {
data() {
return {
import { back, go2, uploadFile } from '@/utils/hook.js'
import { employeeList,deleteEmployee } from '@/apis/setting.js'
export default {
data() {
return {
orderOption: {
size: 10,
auto: true,
emptyText: '暂无用户~',
background: '#F7F8FA',
fontSize: '40rpx'
},
params: {
asc: '',
desc: ''
},
pagination: {
pageNum: 0, //
pageSize: 10
},
list:[],
deleteId:''
}
},
onShow() {
this.getList()
},
methods: {
back,
addAccount() {
go2('add-account')
},
deleteAccount(item){
// deleteEmployee
this.$refs.popup.open()
this.deleteId = item.id
},
confirm(){
var params= {
id:this.deleteId,
enterpriseId: this.$store.state.supplierInfo.id,
}
deleteEmployee(params)
.then(res => {
if (res) {
uni.showToast({
title: '删除成功',
icon: 'success'
})
this.close()
}
})
.catch(err => {
reject(err)
})
},
close(){
this.$refs.popup.close()
},
//
getList() {
return new Promise((resolve, reject) => {
employeeList({ ...this.params, ...this.pagination })
.then(res => {
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch(err => {
reject(err)
})
})
},
//
orderUp(page) {
this.pagination.pageNum++
this.getList()
.then(({ list, total }) => {
this.$refs.orderRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.orderRef.loadFail()
})
},
methods: {
back,
addAccount(){}
//
orderDown() {
this.pagination.pageNum = 1
this.getList()
.then(({ list, total }) => {
this.$refs.orderRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.orderRef.refreshFail()
})
}
}
}
</script>
<style lang="scss">
.account-management{
.account-management {
.account-management-title {
width: 100%;
font-size: 36rpx;
@ -35,12 +146,59 @@
text-align: center;
font-weight: 500;
}
.add-account{
.add-account {
font-size: 28rpx;
color: #007AFF;
color: #007aff;
text-align: right;
line-height: 40rpx;
font-weight: 500;
}
.list-image {
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
}
.account-list {
display: flex;
align-items: center;
height: 148rpx;
background-color: #ffffff;
}
.account-name {
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
font-weight: 500;
}
.account-phone {
font-size: 26rpx;
color: #888888;
letter-spacing: 0;
text-align: left;
line-height: 32rpx;
font-weight: 400;
}
.account-delete {
font-size: 28rpx;
color: #f5222d;
text-align: right;
line-height: 40rpx;
font-weight: 400;
}
.account-text {
width: 60%;
line-height: 60rpx;
}
.account-iamge-width {
margin-left: 32rpx;
width: 15%;
}
.account-dialog-text{
font-size: 28rpx;
color: #969799;
text-align: center;
line-height: 40rpx;
font-weight: 400;
}
}
</style>

262
pages/add-account/index.vue

@ -1,22 +1,262 @@
<template>
<view>
<view class="add-account">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="add-account-title">新增企业账号</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="">
<view class="add-paper-list">
<view>
<text class="add-paper-start"><uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons></text>
<text class="add-paper-text">手机号</text>
</view>
<view class="add-paper-input">
<qn-easyinput
type="number"
:maxlength="11"
:styles="{ disableColor: '#fff' }"
v-model="form.mobile"
:inputBorder="false"
text="right"
placeholder="请输入手机号"
></qn-easyinput>
</view>
</view>
<view class="add-paper-border"></view>
<view class="add-paper-list">
<view>
<text class="add-paper-start"><uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons></text>
<text class="add-paper-text">用户号</text>
</view>
<view class="add-paper-input">
<qn-easyinput type="text" :styles="{ disableColor: '#fff' }" v-model="form.name" :inputBorder="false" text="right" placeholder="请输入用户号"></qn-easyinput>
</view>
</view>
<view class="add-paper-border"></view>
<view class="add-paper-list" @click="paperpopupShow()">
<view>
<text class="add-paper-start"><uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons></text>
<text class="add-paper-text">职务</text>
</view>
<!-- categoryId -->
<view class="">
<text v-if="form.title === ''" class="add-paph-text">点击选择职务</text>
<text v-else>{{ form.title }}</text>
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
<view class="uploud-btn">
<view class=""><button type="primary" class="btn-class" plain="true" @click="cencelList()">取消</button></view>
<view class=""><button type="primary" class="btn-class-upload" @click="uploadData()">确认</button></view>
</view>
<uni-popup ref="paperpopup" type="bottom">
<view class="popup_modal">
<!-- <slot name="title"><view class="popup_modal-title">选择纸种</view></slot> -->
<scroll-view scroll-y="true" class="popup_modal-scroll">
<view @click="paperSelectChange(item)" class="popup_modal-scroll-item" v-for="item in paperList" :key="item.id">{{ item.name }}</view>
<uGap></uGap>
<view class="cencel-btn" @click="cencelbtn">取消</view>
</scroll-view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
}
import { back, go2, uploadFile } from '@/utils/hook.js'
import uGap from '@/components/u-gap/u-gap.vue'
import { addEmployee } from '@/apis/setting.js'
const validateFields = ['mobile', 'name', 'title']
export default {
data() {
return {
form: {
title: ''
},
paperList: [
{
name: '管理员',
id: '1'
},
{
name: '业务员',
id: '2'
},
{
name: '司机',
id: '3'
},
{
name: '分切',
id: '4'
},
{
name: '库管',
id: '5'
}
]
}
},
components: { uGap },
methods: {
back,
paperpopupShow() {
this.$refs.paperpopup.open('bottom')
},
paperSelectChange(item) {
this.$set(this.form, 'title', item.name)
this.$refs.paperpopup.close()
},
methods: {
cencelbtn() {
this.$refs.paperpopup.close()
},
cencelList(){
back()
},
uploadData() {
for (let i = 0; i < validateFields.length; i++) {
if (this.form[validateFields[i]] === null || this.form[validateFields[i]] === '') {
uni.showToast({
title: '请完善信息',
icon: 'none'
})
return
}
}
var params = {
...this.form,
enterpriseId: this.$store.state.supplierInfo.id,
// userId:this.$store.state.userInfo.userId,
}
addEmployee(params).then(res => {
if (res) {
uni.showToast({
title: '添加成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
}
</script>
<style>
<style lang="scss">
.add-account {
.add-account-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.add-account {
font-size: 28rpx;
color: #007aff;
text-align: right;
line-height: 40rpx;
font-weight: 500;
}
.add-paper-border {
border-bottom: 2rpx solid #d8d8d8;
margin-left: 32rpx;
}
.add-paper-list {
height: 88rpx;
background: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 32rpx;
padding-right: 32rpx;
}
.add-paper-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
.add-paper-start {
font-size: 28rpx;
color: #f5222d;
letter-spacing: 0;
font-weight: 400;
}
.add-paper-input {
width: 40%;
}
.popup_modal {
width: 750rpx;
height: 600rpx;
background-color: #fff;
border-radius: 10rpx 10rpx 0 0;
.popup_modal-title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 750rpx;
height: 88rpx;
font-weight: 600;
border-bottom: 2rpx solid #d8d8d8;
}
.popup_modal-scroll {
width: 750rpx;
height: 600rpx;
.popup_modal-scroll-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 750rpx;
height: 88rpx;
padding: 0rpx 32rpx;
border-bottom: 2rpx solid #d8d8d8;
}
}
}
.cencel-btn {
font-size: 32rpx;
color: #646566;
text-align: center;
line-height: 44rpx;
font-weight: 400;
margin-top: 40rpx;
}
.add-paph-text {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
}
.btn-class {
height: 88rpx;
border-radius: 10rpx;
line-height: 80rpx;
width: 150px;
}
.btn-class-upload {
height: 88rpx;
border-radius: 10rpx;
line-height: 80rpx;
width: 200px;
}
.uploud-btn {
display: flex;
justify-content: space-between;
padding: 20rpx 32rpx;
background-color: #ffffff;
position: absolute;
bottom: 0rpx;
width: 100%;
}
}
</style>

66
pages/add-paper/index.vue

@ -14,7 +14,7 @@
<text class="add-paper-text">纸品名称</text>
</view>
<view class="add-paper-input">
<qn-easyinput type="text" :styles="{ disableColor: '#fff' }" v-model="form.name" :inputBorder="false" text="right" placeholder="请输入纸品名称"></qn-easyinput>
<qn-easyinput type="text" :maxlength="100" :styles="{ disableColor: '#fff' }" v-model="form.name" :inputBorder="false" text="right" placeholder="请输入纸品名称"></qn-easyinput>
</view>
</view>
<view class="add-paper-border"></view>
@ -30,6 +30,7 @@
v-model="form.manufacturerName"
:inputBorder="false"
text="right"
:maxlength="100"
placeholder="请输入纸厂信息"
></qn-easyinput>
</view>
@ -47,7 +48,8 @@
v-model="form.brandName"
:inputBorder="false"
text="right"
placeholder="请输入纸品品牌名称"
:maxlength="50"
placeholder="请输入品牌信息"
></qn-easyinput>
</view>
</view>
@ -57,12 +59,21 @@
<text class="add-paper-start"><uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons></text>
<text class="add-paper-text">纸种信息</text>
</view>
<qn-easyinput
type="text"
:styles="{ disableColor: '#fff' }"
v-model="form.categoryName"
:inputBorder="false"
text="right"
:maxlength="50"
placeholder="请输入纸种信息"
></qn-easyinput>
<!-- categoryId -->
<view class="" @click="paperpopupShow()">
<!-- <view class="" @click="paperpopupShow()">
<text v-if="form.categoryId === null" class="add-paph-text">请选择纸种信息</text>
<text v-else>{{ form.categoryName }}</text>
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view> -->
</view>
<view class="add-paper-border"></view>
<view class="add-paper-list">
@ -94,11 +105,12 @@
</view>
<view class="label_value">
<qn-easyinput
type="digit"
type="number"
:styles="{ disableColor: '#F7F8FA', borderBottom: '1px solid red' }"
v-model="item.weight"
:inputBorder="false"
text="right"
:maxlength="9999"
placeholder="请输入纸品克重"
></qn-easyinput>
</view>
@ -166,6 +178,7 @@
v-model="item.minimum"
:inputBorder="false"
text="right"
:maxlength="9999999999"
placeholder="请输入最低起送量"
></qn-easyinput>
<view class="paper-price-title text-left">{{ item.stockUnit === '1' ? '张' : '吨' }}</view>
@ -183,7 +196,7 @@
file-mediatype="image"
mode="grid"
file-extname="png,jpg"
:limit="6"
:limit="5"
:image-styles="imageStyles"
@progress="progress"
@success="success"
@ -252,7 +265,7 @@
v-model="form.otherNote"
:inputBorder="false"
type="textarea"
placeholder="请输入其他说明"
placeholder="请输入"
></qn-easyinput>
</view>
</view>
@ -285,7 +298,7 @@ import { back, go2, uploadFile } from '@/utils/hook.js'
import qnEasyinput from '@/components/qn-easyinput/qn-easyinput.vue'
import uGap from '@/components/u-gap/u-gap.vue'
import { getCategoryList, createProduct, getSupplierDteail, updateProduct } from '@/apis/add-paper.js'
const validateFields = ['name', 'isMainProductRep', 'manufacturerName', 'brandName', 'categoryId']
const validateFields = ['name', 'isMainProductRep', 'manufacturerName', 'brandName', 'categoryName']
const validatePriceFields = ['isPromoting', 'listPrice', 'minimum', 'stock', 'stockUnit', 'weight']
export default {
components: {
@ -300,7 +313,11 @@ export default {
isMainProductRep: 0,
manufacturerName: null,
brandName: null,
categoryId: null
categoryName: null,
sellingProposition:'月结30天价格,不加服务费!',
description:'售价全部为含税价,支持先用后付,欢迎来电查询!近期价格波动较大,请下单前先咨询价格。',
shippingNote:'分切纸不足重量的,另加调机费;低于送货重量或超出送货范围的,运费另计。'
},
imageStyles: {
width: 100,
@ -325,16 +342,7 @@ export default {
}
],
paperList: [],
skuList: [
{
isPromoting: 0,
listPrice: null,
minimum: null,
stock: null,
stockUnit: '1',
weight: null
}
],
skuList: [],
imgList: [],
priceIndex: 0,
eidtFor: 0,
@ -372,7 +380,7 @@ export default {
},
paperSelectChange(item) {
this.$set(this.form, 'categoryName', item.name)
this.$set(this.form, 'categoryId', item.id)
// this.$set(this.form, 'categoryId', item.id)
this.$refs.paperpopup.close()
},
paperpopupShow() {
@ -400,11 +408,11 @@ export default {
this.skuList[j].isPromoting = 1
}
}
for(let x =0;x<this.paperList.length;x++){
if(this.paperList[x].id === this.form.categoryId){
this.$set(this.form,'categoryName',this.paperList[x].name)
}
}
// for(let x =0;x<this.paperList.length;x++){
// if(this.paperList[x].id === this.form.categoryId){
// this.$set(this.form,'categoryName',this.paperList[x].name)
// }
// }
this.imgList = []
for (let i = 0; i < res.imgList.length; i++) {
var params = {
@ -421,13 +429,13 @@ export default {
//
addPriceClick() {
this.skuList.push({
isPromoting: 0,
isPromoting: 1,
listPrice: null,
minimum: null,
stock: null,
stockUnit: '1',
stockUnit: '2',
weight: null,
categoryId: null
categoryName: null
})
},
//
@ -589,7 +597,7 @@ export default {
}
.add-paper-border {
border-bottom: 2rpx solid #d8d8d8;
margin-left: 16px;
margin-left: 32rpx;
}
.paper-price {
background-color: #ffffff;

18
pages/mall/index.vue

@ -38,14 +38,14 @@
<view class="sub-title">{{ item.categoryName }}/{{ item.name }}/{{ item.manufacturerName }}</view>
<view class="desc">
克重(价格)
<text v-for="(sku, index) in item.skuList">{{ sku.weight }}({{ sku.listPrice }})</text>
<text v-for="(sku, index) in item.skuList" :key="index">{{ sku.weight }}({{ sku.listPrice }})</text>
</view>
</view>
</view>
<view class="other">
<view class="time">{{ item.updateTime }}</view>
<view class="time">{{ item.updateTime | timeFilter }}</view>
<view class="btn">
<view class="" @click="editPaper(item)">编辑</view>
<view class="" @click="editPaper(item)" v-if="item.status === 30112">编辑</view>
<view class="divide"></view>
<view class="" @click="productStatusChange(item)">{{ item.status === 30111 ? '下架' : '上架' }}</view>
</view>
@ -65,9 +65,19 @@
import uGap from '@/components/u-gap/u-gap.vue'
import { back, go2, loginGo2 } from '@/utils/hook.js'
import { SupplierList, productStatus } from '@/apis/add-paper.js'
import { getTimer } from '@/utils/index.js'
import noData from './no-data.vue'
export default {
components: { uGap, noData },
filters: {
timeFilter(value) {
var abs = ''
if (value) {
abs = getTimer(value)
}
return abs
}
},
data() {
return {
pageShow: true,
@ -112,12 +122,12 @@ export default {
},
methods: {
back,
// pageShow
quertData() {
return new Promise((resolve, reject) => {
SupplierList({ ...this.orderPagination })
.then((res) => {
console.log('纸品列表', res)
if (res) {
if (res.records.length === 0) {
this.pageShow = false

2
pages/mine/index.vue

@ -270,6 +270,8 @@ export default {
}
}
},
onLoad() {
},
onShow() {
getBaseInfo({}, true).then((res) => {
if (res) {

37
pages/quotation-details/index.vue

@ -4,13 +4,13 @@
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="submit-title">报价详情</view>
<view slot="left"></view>
<view slot="right" class="edit-price" @click="editPrice()">修改报价</view>
<view slot="right" class="edit-price" v-if="upDataObj.replyStatus !== 30102" @click="editPrice()">修改报价</view>
</uni-nav-bar>
</view>
<view class="submit-main">
<view>
<text class="submit-main-title">交货要求</text>
<text class="price-tips">已报价</text>
<text class="" :class="upDataObj.replyStatus === 30102 ?'price-tips-gq':'price-tips'">{{ upDataObj.replyStatus | replyFilter }}</text>
</view>
<view>
<text class="submit-main-subTitle">询价客户</text>
@ -86,6 +86,30 @@ export default {
qnHeader,
uGap
},
filters: {
replyFilter(value) {
var abs = ''
if (value) {
// 30128 30130 30139 30102
switch (value) {
case 30128:
abs = '待报价'
break
case 30130:
abs = '已报价'
break
case 30139:
abs = '转化订单'
break
case 30102:
abs = '已失效'
break
default:
break
}
}
}
},
data() {
return {
value: '',
@ -565,7 +589,14 @@ export default {
font-size: 30rpx;
color: #ff5368;
letter-spacing: 0;
text-align: right;
font-weight: 500;
float: right;
padding-right: 32rpx;
}
.price-tips-gq {
font-size: 30rpx;
color: #888888;
letter-spacing: 0;
font-weight: 500;
float: right;
padding-right: 32rpx;

173
pages/setting/index.vue

@ -1,83 +1,92 @@
<template>
<view class="system-settimg">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="system-settimg-title">系统设置</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="list-main" v-for="(item, index) in name" :key="index">
<view class="list-flex" :class="index + 1 === name.length ? '' : 'list-border'" @click="checkList(index)">
<view class="list-text">
<text>{{ item }}</text>
</view>
<view class="">
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
</view>
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
export default {
data() {
return {
name: ['用户名', '账号管理', '用户协议', '系统权限', '关于纸掌柜']
}
},
methods: {
back,
checkList(item) {
switch (item) {
case 0:
go2('user-info')
break
case 1:
go2('account-management')
break
case 4:
go2('about')
break
default:
break
}
}
}
}
</script>
<style lang="scss">
.system-settimg {
.system-settimg-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.list-main {
background-color: #ffffff;
}
.list-border {
border-bottom: 2rpx solid #d8d8d8;
}
.list-flex {
display: flex;
justify-content: space-between;
margin: 0rpx 32rpx;
height: 100rpx;
align-items: center;
}
.list-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
}
<template>
<view class="system-settimg">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="system-settimg-title">系统设置</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="list-main" v-for="(item, index) in name" :key="index">
<view class="list-flex" :class="index + 1 === name.length ? '' : 'list-border'" @click="checkList(index)">
<view class="list-text">
<text>{{ item }}</text>
</view>
<view class="">
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
</view>
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
export default {
data() {
return {
name: ['用户名', '账号管理', '用户协议', '系统权限', '关于纸掌柜']
}
},
methods: {
back,
checkList(item) {
switch (item) {
case 0:
go2('user-info')
break
case 1:
go2('account-management')
break
case 2:
go2('agreement')
break
case 3:
let main = plus.android.runtimeMainActivity()
let Intent = plus.android.importClass('android.content.Intent')
let mIntent = new Intent('android.settings.WIRELESS_SETTINGS')
main.startActivity(mIntent)
break
case 4:
go2('about')
break
default:
break
}
}
}
}
</script>
<style lang="scss">
.system-settimg {
.system-settimg-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.list-main {
background-color: #ffffff;
}
.list-border {
border-bottom: 2rpx solid #d8d8d8;
}
.list-flex {
display: flex;
justify-content: space-between;
margin: 0rpx 32rpx;
height: 100rpx;
align-items: center;
}
.list-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
}
</style>

11
pages/submit-quotation/index.vue

@ -41,7 +41,7 @@
<view class="submit-contant" v-for="(items, index) in upDataObj.itemList" :key="index">
<view class="submit-contant-head">
<view class="submit-contant-title">{{ items.paperName }}|{{ items.gramWeight }}|{{ items.length }}*{{ items.width }}|{{ items.quantity }}</view>
<view class="" @click="commodityModify(items, index)"><image class="submit-image" src="../../static/imgs/trade/myPrice.png" mode=""></image></view>
<view class="" v-if="upDataObj.replyStatus !== 30102" @click="commodityModify(items, index)"><image class="submit-image" src="../../static/imgs/trade/myPrice.png" mode=""></image></view>
</view>
<view class="submit-contant-body">
<view class="">
@ -52,7 +52,7 @@
<text class="submit-contant-body-title">单价(/)</text>
<text class="submit-contant-body-subtitle">
{{ items.unitFee }}
<image @click="priceModify(items, index)" class="submit-image-price" src="../../static/imgs/trade/myPrice.png" mode=""></image>
<image v-if="upDataObj.replyStatus !== 30102" @click="priceModify(items, index)" class="submit-image-price" src="../../static/imgs/trade/myPrice.png" mode=""></image>
</text>
</view>
<view>
@ -80,7 +80,7 @@
<text class="submit-contant-time-title">有效时间</text>
<text class="submit-contant-time-title">{{ upDataObj.enquiryValidTime }}</text>
</view>
<view class="" @click="resetTime()"><text class="submit-contant-time-subtitle">设置</text></view>
<view class="" v-if="upDataObj.replyStatus !== 30102" @click="resetTime()"><text class="submit-contant-time-subtitle">设置</text></view>
</view>
<uGap></uGap>
<view class="submit-contant-remark">
@ -88,7 +88,7 @@
<view class=""><uni-easyinput maxlength="200" type="textarea" class="submit-contant-remark-input" v-model="value1" placeholder="请输入内容"></uni-easyinput></view>
</view>
<uGap></uGap>
<view class="submit-btnBg"><button class="submit-btn" type="primary" @click="updataQuery()">提交报价</button></view>
<view class="submit-btnBg" v-if="upDataObj.replyStatus !== 30102"><button class="submit-btn" type="primary" @click="updataQuery()">提交报价</button></view>
<view class="">
<uni-popup ref="popup" :mask-click="false">
<view class="submit-popup">
@ -273,6 +273,7 @@ export default {
this.$set(this.upDataObj, 'enquiryValidTimeSplit', timeabs)
this.$set(this.upDataObj, 'otherFee', 0)
this.$set(this.upDataObj, 'totalAllPrice', 0)
this.priceFree()
console.log('this.upDataObj', res)
}
})
@ -387,6 +388,8 @@ export default {
this.priceFree()
},
priceFree() {
this.upDataObj.totalAllPrice = 0
this.upDataObj.otherFee = 0
for (let i = 0; i < this.upDataObj.itemList.length; i++) {
var totalAllPrice = parseFloat(this.upDataObj.totalAllPrice) + parseFloat(this.upDataObj.itemList[i].totalPrice)
this.upDataObj.totalAllPrice = totalAllPrice.toFixed(2)

572
pages/trade/quotationList.vue

@ -1,64 +1,52 @@
<template>
<view class="quotation-list">
<scroll-list ref="quotationRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index">
<view class="list-border list-title-line">
<text class="list-title">{{ item.belongEnterpriseName }}</text>
<text class="list-title-Subtitle">{{ item.replyStatus | replyStatusName }}</text>
</view>
<view class="list-border list-info-line">
<view
class="list-info"
:class="subIndex + 1 === item.itemList.length ? '' : 'list-border'"
v-for="(subItem, subIndex) in item.itemList"
:key="subIndex"
>
<view class="">
<!-- <image class="list-image" src="../../static/logo.png" mode=""></image> -->
<image class="list-image" :src="subItem.productImg" mode=""></image>
</view>
<view class="list-info-contant">
<view class="list-info-title">{{ subItem.brandName }}</view>
<view class="list-info-text">
{{ subItem.categoryName }}/{{ subItem.paperName }}/{{ subItem.gramWeight }}g/{{ subItem.length }}*{{ subItem.width }}/{{ subItem.quantity }}
</view>
</view>
</view>
<!-- <view class="list-info">
<view class=""><image class="list-image" src="../../static/logo.png" mode=""></image></view>
<view class="list-info-contant">
<view class="list-info-title">金蝶蓝白卡</view>
<view class="list-info-text">白卡纸/金蝶蓝/350g/787*1092/2200</view>
<view class="quotation-list">
<scroll-list ref="quotationRef" :option="option" @load="quotationUp" @refresh="quotationDown">
<view v-for="(item, index) in list" :key="index">
<view class="list-border list-title-line">
<text class="list-title">{{ item.belongEnterpriseName }}</text>
<text class="list-title-Subtitle">{{ item.replyStatus | replyStatusName }}</text>
</view>
<view class="" @click="offerClick(item)">
<view class="list-border list-info-line">
<view class="list-info" :class="subIndex + 1 === item.itemList.length ? '' : 'list-border'" v-for="(subItem, subIndex) in item.itemList" :key="subIndex">
<view class=""><image class="list-image" :src="subItem.productImg" mode=""></image></view>
<view class="list-info-contant">
<view class="list-info-title">{{ subItem.brandName }}</view>
<view class="list-info-text">
{{ subItem.categoryName }}/{{ subItem.paperName }}/{{ subItem.gramWeight }}g/{{ subItem.length }}*{{ subItem.width }}/{{ subItem.quantity }}
</view>
</view>
</view>
</view> -->
</view>
<view class="list-border list-bottom-contant">
<view>
<text>交货时间</text>
<text>{{ item.deliveryDay }}</text>
</view>
<view>
<text>交货区域</text>
<text>{{ item.deliveryArea }}</text>
</view>
<view class="offer-class">
<view class="offer-width">
<text>报价截止</text>
<text>{{ item.enquiryValidTime }}</text>
</view>
<view><button type="primary" class="offer-btn" @click="offerClick(item)">报价</button></view>
</view>
</view>
<uGap></uGap>
</view>
</scroll-list>
<view>
<view class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/myPrice.png" mode=""></image>
<view class="my-price">我的报价</view>
</view>
</view>
</view>
</view>
<view class="list-border list-bottom-contant" >
<view>
<text>交货时间</text>
<text>{{ item.deliveryDay }}</text>
</view>
<view>
<text>交货区域</text>
<text>{{ item.deliveryArea }}</text>
</view>
<view class="offer-class">
<view class="offer-width">
<text>报价截止</text>
<text>{{ item.enquiryValidTime }}</text>
</view>
<view><button type="primary" class="offer-btn">报价</button></view>
</view>
</view>
</view>
<uGap></uGap>
</view>
</scroll-list>
<view>
<view class="offer-prices" @click="nativeTo()">
<image class="my-image" src="../../static/imgs/trade/myPrice.png" mode=""></image>
<view class="my-price">我的报价</view>
</view>
</view>
</view>
</template>
<script>
@ -66,244 +54,244 @@ import { getEnterpriseList } from '@/apis/trade'
import { back, go2 } from '@/utils/hook.js'
import uGap from '@/components/u-gap/u-gap.vue'
export default {
props: {
queryData: {
type: Object,
default: () => {}
}
},
components: {
uGap
},
props: {
queryData: {
type: Object,
default: () => {}
}
},
components: {
uGap
},
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无报价信息~',
background: '#F7F8FA',
fontSize: '40rpx'
},
params: {
asc: '',
desc: '',
// mallSupplierIds: [this.$store.state.supplierInfo.supplierId], // ID
mallSupplierIds: ['553703427180466176'] // ID
},
pagination: {
pageNum: 0, //
pageSize: 10
},
list: []
}
},
onShow() {
this.getQuotationQurty()
},
onLoad(option) {},
filters: {
replyStatusName(status) {
let name = ''
// 30128 30130 30139 30102
switch (status) {
case 30128:
name = '待报价'
break
case 30130:
name = '已报价'
break
case 30139:
name = '转化订单'
break
case 30102:
name = '已失效'
break
default:
break
}
return name
}
},
methods: {
//
getQuotationQurty() {
return new Promise((resolve, reject) => {
getEnterpriseList({ ...this.params, ...this.pagination })
.then((res) => {
console.log('获取报价列表', res)
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
// this.list = []
// this.list = [{ name: '111', id: '222' }, { name: '111', id: '222' }]
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
reject(err)
})
})
},
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无报价信息~',
background: '#F7F8FA',
fontSize: '40rpx'
},
params: {
asc: '',
desc: '',
// mallSupplierIds: [this.$store.state.supplierInfo.supplierId], // ID
mallSupplierIds: ['553703427180466176'] // ID
},
pagination: {
pageNum: 0, //
pageSize: 20
},
list: []
}
},
onShow() {
this.getQuotationQurty()
},
onLoad(option) {},
filters: {
replyStatusName(status) {
let name = ''
// 30128 30130 30139 30102
switch (status) {
case 30128:
name = '待报价'
break
case 30130:
name = '已报价'
break
case 30139:
name = '转化订单'
break
case 30102:
name = '已失效'
break
default:
break
}
return name
}
},
methods: {
//
getQuotationQurty() {
return new Promise((resolve, reject) => {
getEnterpriseList({ ...this.params, ...this.pagination })
.then(res => {
console.log('获取报价列表', res)
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
// this.list = []
// this.list = [{ name: '111', id: '222' }, { name: '111', id: '222' }]
} else {
this.list = this.list.concat(res.records)
}
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch(err => {
reject(err)
})
})
},
//
quotationUp(page) {
this.pagination.pageNum++
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.loadFail()
})
},
//
quotationDown() {
this.pagination.pageNum = 1
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.refreshFail()
})
},
//
offerClick(item) {
var params = {
...item,
title: '提交报价',
}
go2('submit-quotation', params)
},
//
nativeTo() {
go2('my-offer')
}
}
//
quotationUp(page) {
this.pagination.pageNum++
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.loadFail()
})
},
//
quotationDown() {
this.pagination.pageNum = 1
this.getQuotationQurty()
.then(({ list, total }) => {
this.$refs.quotationRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.quotationRef.refreshFail()
})
},
//
offerClick(item) {
var params = {
...item,
title: '提交报价'
}
go2('submit-quotation', params)
},
//
nativeTo() {
go2('my-offer')
}
}
}
</script>
<style lang="scss">
.quotation-list {
margin-bottom: 0rpx;
.list-border {
// border-top: 1px solid #dddddd;
border-bottom: 2rpx solid #dddddd;
}
.list-title-line {
line-height: 88rpx;
padding-left: 48rpx;
background: #ffffff;
}
.list-title {
font-family: PingFangSC-Semibold;
font-size: 30rpx;
color: #000000;
letter-spacing: 0;
font-weight: 600;
}
.list-title-Subtitle {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #ff5368;
letter-spacing: 0;
text-align: right;
font-weight: 500;
float: right;
margin-right: 32rpx;
}
.list-info-line {
padding-left: 48rpx;
line-height: 70rpx;
background: #ffffff;
}
.list-info-contant {
margin-left: 48rpx;
background: #ffffff;
}
.list-info-title {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
text-align: left;
font-weight: 550;
}
.list-info-text {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #888888;
letter-spacing: 0;
text-align: left;
line-height: 64rpx;
font-weight: 400;
}
.list-image {
width: 100rpx;
height: 100rpx;
margin-top: 20rpx;
}
.list-info {
display: flex;
}
.list-bottom-contant {
line-height: 70rpx;
padding-left: 48rpx;
padding-bottom: 48rpx;
background: #ffffff;
}
.my-image {
width: 32rpx;
height: 32rpx;
}
.my-price {
font-family: PingFangSC-Medium;
font-size: 18rpx;
color: #007aff;
text-align: center;
font-weight: 500;
white-space: nowrap;
padding: 6rpx;
}
.offer-class {
display: flex;
justify-content: space-between;
}
.offer-btn {
width: 150rpx;
height: 64rpx;
background: #007aff;
border: 2rpx solid #007aff;
border-radius: 8rpx;
line-height: 60rpx;
margin-right: 32rpx;
}
.offer-width {
width: 70%;
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #ffffff;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
margin-bottom: 0rpx;
.list-border {
// border-top: 1px solid #dddddd;
border-bottom: 2rpx solid #dddddd;
}
.list-title-line {
line-height: 88rpx;
padding-left: 48rpx;
background: #ffffff;
}
.list-title {
font-family: PingFangSC-Semibold;
font-size: 30rpx;
color: #000000;
letter-spacing: 0;
font-weight: 600;
}
.list-title-Subtitle {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #ff5368;
letter-spacing: 0;
text-align: right;
font-weight: 500;
float: right;
margin-right: 32rpx;
}
.list-info-line {
padding-left: 48rpx;
line-height: 70rpx;
background: #ffffff;
}
.list-info-contant {
margin-left: 48rpx;
background: #ffffff;
}
.list-info-title {
font-family: PingFangSC-Medium;
font-size: 30rpx;
color: #333333;
letter-spacing: 0;
text-align: left;
font-weight: 550;
}
.list-info-text {
font-family: PingFangSC-Regular;
font-size: 26rpx;
color: #888888;
letter-spacing: 0;
text-align: left;
line-height: 64rpx;
font-weight: 400;
}
.list-image {
width: 100rpx;
height: 100rpx;
margin-top: 20rpx;
}
.list-info {
display: flex;
}
.list-bottom-contant {
line-height: 70rpx;
padding-left: 48rpx;
padding-bottom: 48rpx;
background: #ffffff;
}
.my-image {
width: 32rpx;
height: 32rpx;
}
.my-price {
font-family: PingFangSC-Medium;
font-size: 18rpx;
color: #007aff;
text-align: center;
font-weight: 500;
white-space: nowrap;
padding: 6rpx;
}
.offer-class {
display: flex;
justify-content: space-between;
}
.offer-btn {
width: 150rpx;
height: 64rpx;
background: #007aff;
border: 2rpx solid #007aff;
border-radius: 8rpx;
line-height: 60rpx;
margin-right: 32rpx;
}
.offer-width {
width: 70%;
}
.offer-prices {
position: absolute;
z-index: 9999;
right: 32rpx;
bottom: 122rpx;
background-color: #ffffff;
border-radius: 50%;
padding: 10rpx;
text-align: center;
width: 110rpx;
height: 110rpx;
border: 2rpx solid #f9f9f9;
box-shadow: 0rpx 4rpx 34rpx 0rpx rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
}
</style>
</style>

4
pages/user-info/index.vue

@ -51,6 +51,7 @@ import { employeeName, } from '@/apis/setting.js'
title: '修改成功',
icon: 'success'
})
syncStore()
setTimeout(() => {
back()
}, 1000)
@ -75,7 +76,6 @@ import { employeeName, } from '@/apis/setting.js'
font-weight: 500;
}
.user-btn{
width: 108rpx;
height: 54rpx;
background: #007AFF;
border-radius: 27rpx;
@ -83,7 +83,7 @@ import { employeeName, } from '@/apis/setting.js'
color: #FFFFFF;
letter-spacing: 0;
font-weight: 500;
line-height: 60rpx;
line-height: 54rpx;
}
.user-text{
font-size: 28rpx;

221
utils/index.js

@ -6,25 +6,59 @@ import store from '@/store/index.js'
* @param fmt string 转化的格式 yyyy-mm-dd hh:MM:ss
*/
export const dateTimeFormat = (date, fmt) => {
if (!date) {
throw new Error('日期不正确')
}
let ret
const opt = {
'y+': date.getFullYear().toString(), // 年
'm+': (date.getMonth() + 1).toString(), // 月
'd+': date.getDate().toString(), // 日
'h+': date.getHours().toString(), // 时
'M+': date.getMinutes().toString(), // 分
's+': date.getSeconds().toString() // 秒
}
for (let k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt)
if (ret) {
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0'))
}
}
return fmt
if (!date) {
throw new Error('日期不正确')
}
let ret
const opt = {
'y+': date.getFullYear().toString(), // 年
'm+': (date.getMonth() + 1).toString(), // 月
'd+': date.getDate().toString(), // 日
'h+': date.getHours().toString(), // 时
'M+': date.getMinutes().toString(), // 分
's+': date.getSeconds().toString() // 秒
}
for (let k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt)
if (ret) {
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0'))
}
}
return fmt
}
/**
* 日期格式化文字描述样例 yyyy-mm-dd hh:MM:ss
* @param stringTime 需要转换的日期
*/
export const getTimer = (stringTime) => {
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var week = day * 7;
var month = day * 30;
var time1 = new Date().getTime(); //当前的时间戳
console.log(time1);
var time2 = Date.parse(new Date(stringTime)); //指定时间的时间戳
console.log(time2);
var time = time1 - time2;
var result = null;
if (time < 0) {
} else if (time / month >= 1) {
result = parseInt(time / month) + "月前";
} else if (time / week >= 1) {
result = parseInt(time / week) + "周前";
} else if (time / day >= 1) {
result = parseInt(time / day) + "天前";
} else if (time / hour >= 1) {
result = parseInt(time / hour) + "小时前";
} else if (time / minute >= 1) {
result = parseInt(time / minute) + "分钟前";
} else {
result = "刚刚";
}
return result;
}
/**
@ -34,81 +68,88 @@ export const dateTimeFormat = (date, fmt) => {
* @value {true} retry 是否重连默认false
* @returns 一个websocket实例
*/
export const makeSocket = async ({ pageInfo = '', retry = false }) => {
const socket = {
sockTask: null,
close: function () {
this.sockTask.close({ code: 1000 })
closeFlag = true
},
onMessage: function () {}
}
export const makeSocket = async ({
pageInfo = '',
retry = false
}) => {
const socket = {
sockTask: null,
close: function() {
this.sockTask.close({
code: 1000
})
closeFlag = true
},
onMessage: function() {}
}
let limitedNum = 0
let closeFlag = false
let timer = null
let limitedNum = 0
let closeFlag = false
let timer = null
async function createSocket() {
let url = ''
if (env == 'production') {
url = 'wss://api-client-yyt.qniao.cn/qn-websocket-service/wechatwebsock?token='
} else if (env == 'test') {
url = 'wss://api-client-yyt-test.qniao.cn/qn-websocket-service/wechatwebsock?token='
}
// if (env == 'production') {
// url = 'wss://api-client-yyt.qniao.cn/trading-center/wechatwebsock?token='
// } else if (env == 'test') {
// url = 'wss://api-client-yyt-test.qniao.cn/trading-center/wechatwebsock?token='
// }
const token = store.state.qnToken
const socketTask = await uni.connectSocket({
url: `${url}${token}`,
header: {
'content-type': 'application/json'
},
success: () => {
console.log('websocket连接成功')
},
fail: () => {
console.log('websocket连接失败')
}
})
socketTask.onOpen(() => {
console.log(pageInfo + ' onOpen')
timer = setInterval(() => {
socketTask.send({ data: 'ping' })
}, 10000)
})
socketTask.onClose(() => {
console.log(pageInfo + ' onClose')
clearInterval(timer)
timer = null
if (!closeFlag && retry && limitedNum < 20) {
limitedNum++
console.log('重连次数:' + limitedNum)
createSocket()
}
})
async function createSocket() {
let url = ''
if (env == 'production') {
url = 'wss://api-client-yyt.qniao.cn/qn-websocket-service/wechatwebsock?token='
} else if (env == 'test') {
url = 'wss://api-client-yyt-test.qniao.cn/qn-websocket-service/wechatwebsock?token='
}
// if (env == 'production') {
// url = 'wss://api-client-yyt.qniao.cn/trading-center/wechatwebsock?token='
// } else if (env == 'test') {
// url = 'wss://api-client-yyt-test.qniao.cn/trading-center/wechatwebsock?token='
// }
const token = store.state.qnToken
const socketTask = await uni.connectSocket({
url: `${url}${token}`,
header: {
'content-type': 'application/json'
},
success: () => {
console.log('websocket连接成功')
},
fail: () => {
console.log('websocket连接失败')
}
})
socketTask.onOpen(() => {
console.log(pageInfo + ' onOpen')
timer = setInterval(() => {
socketTask.send({
data: 'ping'
})
}, 10000)
})
socketTask.onClose(() => {
console.log(pageInfo + ' onClose')
clearInterval(timer)
timer = null
if (!closeFlag && retry && limitedNum < 20) {
limitedNum++
console.log('重连次数:' + limitedNum)
createSocket()
}
})
socketTask.onError(() => {
console.log(pageInfo + ' error')
})
socketTask.onError(() => {
console.log(pageInfo + ' error')
})
socket.sockTask = socketTask
}
socket.sockTask = socketTask
}
await createSocket()
if (socket) {
socket.onMessage = (fn) => {
socket.sockTask.onMessage((res) => {
let data = JSON.parse(res.data)
console.log(pageInfo + '接收到消息:', data)
if (data.type != 'heartbeat') {
fn(data)
}
})
}
}
await createSocket()
if (socket) {
socket.onMessage = (fn) => {
socket.sockTask.onMessage((res) => {
let data = JSON.parse(res.data)
console.log(pageInfo + '接收到消息:', data)
if (data.type != 'heartbeat') {
fn(data)
}
})
}
}
return socket
return socket
}
Loading…
Cancel
Save