杨阁辉 4 years ago
parent
commit
11d082919a
12 changed files with 216 additions and 208 deletions
  1. 390
      pages/account-management/index.vue
  2. 2
      pages/client-credit-list/index.vue
  3. 10
      pages/client-detail/base-paper-deals.vue
  4. 2
      pages/client-detail/equipment-information.vue
  5. 2
      pages/client-list/index.vue
  6. 2
      pages/contract-manage/index.vue
  7. 2
      pages/credit-order-list/index.vue
  8. 4
      pages/follow-up-records/index.vue
  9. 2
      pages/start-page/index.vue
  10. 4
      pages/trade/index.vue
  11. 2
      pages/trade/orderList.vue
  12. 2
      pages/trade/quotationList.vue

390
pages/account-management/index.vue

@ -1,206 +1,210 @@
<template>
<view class="account-management">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="account-management-title">账号管理</view>
<view slot="left"></view>
<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>
<view class="account-management">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="account-management-title">账号管理</view>
<view slot="left"></view>
<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'
import { employeeList,deleteEmployee } from '@/apis/setting.js'
import { employeeList, deleteEmployee } from '@/apis/setting.js'
export default {
data() {
return {
orderOption: {
size: 10,
auto: true,
emptyText: '暂无用户~',
background: '#F7F8FA',
fontSize: '40rpx',
emptyImage: '/static/imgs/order/order-empty.png'
},
params: {
asc: '',
desc: '',
enterpriseId: this.$store.state.supplierInfo.id,
},
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()
})
},
//
orderDown() {
this.pagination.pageNum = 1
this.getList()
.then(({ list, total }) => {
this.$refs.orderRef.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.orderRef.refreshFail()
})
}
}
data() {
return {
orderOption: {
size: 10,
auto: true,
emptyText: '暂无用户~',
background: '#F7F8FA',
fontSize: '40rpx',
emptyImage: '/static/imgs/order/order-empty.png'
},
params: {
asc: '',
desc: '',
enterpriseId: this.$store.state.supplierInfo.id
},
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 (res.current == 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()
})
},
//
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-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;
}
.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;
}
.account-management-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;
}
.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>

2
pages/client-credit-list/index.vue

@ -79,7 +79,7 @@ export default {
getFsCreditList({ mallSupplierId: this.$store.state.supplierInfo.supplierId, ...this.pagination })
.then((res) => {
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

10
pages/client-detail/base-paper-deals.vue

@ -19,7 +19,11 @@
</view>
<view class="content" v-for="(subItem, subIndex) in item.supplierOrderList[0].orderItems" :key="subIndex">
<!-- <image class="image" :src="/static/imgs/client/client-default.png" mode=""></image> -->
<image class="image" :src="subItem.productImg || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'" mode=""></image>
<image
class="image"
:src="subItem.productImg || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/paper-default-small.png'"
mode=""
></image>
<view class="">
<view class="title">{{ subItem.productName }}</view>
<view class="desc">
@ -75,7 +79,7 @@ export default {
params: {
asc: '',
desc: '',
customerEnterpriseId: this.id,
customerEnterpriseId: this.id,
mallSupplierId: this.$store.state.supplierInfo.supplierId || null, // id
// customerEnterpriseId: '651107734133018624', // ID
// mallSupplierId: '670334117090562048', // id
@ -115,7 +119,7 @@ export default {
.then((res) => {
// console.log('', res)
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

2
pages/client-detail/equipment-information.vue

@ -184,7 +184,7 @@ export default {
el.collapse = false
el.isShowSelect = false
})
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

2
pages/client-list/index.vue

@ -98,7 +98,7 @@ export default {
getCompanyList({ ...this.params, ...this.pagination })
.then((res) => {
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

2
pages/contract-manage/index.vue

@ -125,7 +125,7 @@ export default {
getContractList({ ...this.condition, ...this.pagination })
.then((res) => {
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

2
pages/credit-order-list/index.vue

@ -116,7 +116,7 @@ export default {
getFinanceList({ ...this.condition, ...this.pagination })
.then((res) => {
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

4
pages/follow-up-records/index.vue

@ -73,7 +73,7 @@ export default {
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false,
emptyImage: '/static/imgs/order/order-empty.png'
emptyImage: '/static/imgs/order/order-empty.png'
},
params: {
asc: '',
@ -115,7 +115,7 @@ export default {
.then((res) => {
// console.log('', res)
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

2
pages/start-page/index.vue

@ -44,7 +44,7 @@
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
import { go2 } from '@/utils/hook.js'
export default {
data() {
return {

4
pages/trade/index.vue

@ -27,10 +27,10 @@
<view class="" v-if="mainKey === '0'"><not-logged @loginChange="loginChange()"></not-logged></view>
<view class="" v-if="mainKey === '1'">
<view class="content">
<view v-show="current === '0'">
<view v-if="current === '0'">
<quotationList :refresh="refresh"></quotationList>
</view>
<view v-show="current === '1'">
<view v-if="current === '1'">
<orderList :refresh="refresh"></orderList>
</view>
</view>

2
pages/trade/orderList.vue

@ -110,7 +110,7 @@ export default {
getSupplierOrderList({ ...this.params, ...this.pagination })
.then((res) => {
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)

2
pages/trade/quotationList.vue

@ -137,7 +137,7 @@ export default {
.then((res) => {
console.log('获取报价列表', res)
if (res) {
if (this.pagination.pageNum == 1) {
if (res.current == 1) {
this.list = res.records
// this.list = []
// this.list = [{ name: '111', id: '222' }, { name: '111', id: '222' }]

Loading…
Cancel
Save