| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <template>
- <view class="mainBox">
- <uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="商机"
- @clickLeft="back">
- </uni-nav-bar>
- <view class="top-wrapper">
- <uni-section>
- <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="名称">
- </uni-easyinput>
- </uni-section>
- <button class="search_btn" @click="doSearch">搜索</button>
- <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
- </view>
- <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
- <myCard @del="del(item)" :item="item" :index="index+1" :columns="columns" :btnList="btnList"></myCard>
- </view>
- <view style='margin-top: 20vh;' v-if="tableList.length==0">
- <u-empty iconSize='150' textSize='32' text='暂无数据'>
- </u-empty>
- </view>
- <view class="add" @click="add">
- <u-icon name="plus" color="#fff"></u-icon>
- </view>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import {
- getTableList,
- deleteInformation
- } from '@/api/saleManage/businessOpportunity/index.js'
- import myCard from '../components/myCard.vue'
- export default {
- components: {
- myCard,
- },
- data() {
- return {
- tableList: [],
- searchVal: '',
- page: 1,
- size: 10,
- isEnd: false,
- current: {},
- btnList: [{
- name: '详情',
- apiName: '',
- btnType: 'primary',
- type: '1',
- pageUrl: '/pages/saleManage/businessOpportunity/components/drawer',
- }, {
- name: '修改',
- apiName: '',
- btnType: 'primary',
- type: '1',
- pageUrl: '/pages/saleManage/businessOpportunity/add',
- judge: [{
- // authorities: 'eom:businessopportunity:update',
- },{
- key: 'approvalStatus',
- value: [0, 3],
-
- }],
- }, {
- name: '跟进记录',
- apiName: '',
- btnType: 'primary',
- type: '1',
- pageUrl: '/pages/saleManage/businessOpportunity/components/drawer',
- query: '¤t=4',
- judge: [{
- key: 'approvalStatus',
- value: [0, 3]
- }],
- }, {
- name: '删除',
- apiName: 'del',
-
- btnType: 'error ',
- type: '2',
- pageUrl: '',
- judge: [{
- // authorities: 'eom:businessopportunity:delete',
- },{
- key: 'approvalStatus',
- value: [0, 3]
- }],
- }],
- columns: [
- [{
- label: '名称:',
- prop: 'name',
- type: 'title',
- className: 'perce100',
- }],
- [{
- label: '编码:',
- prop: 'code'
- }, {
- label: '客户名称:',
- prop: 'contactName'
- }],
- [{
- label: '产品名称:',
- prop: 'productNames'
- }, {
- label: '商机来源:',
- prop: 'sourceName'
- }],
- [{
- label: '商机阶段:',
- prop: 'stageName'
- }, {
- label: '赢单率:',
- prop: 'winRate',
- formatter: (row) => {
- return row.winRate ? row.winRate + '%' : '';
- }
- }],
- [{
- label: '负责人:',
- prop: 'responsibleName'
- }, {
- label: '创建人:',
- prop: 'createUserName'
- }],
- [{
- label: '操作:',
- prop: 'action',
- type: 'action',
- className: 'perce100',
- }],
- ]
- }
- },
- computed: {
- },
- onShow() {
- this.isEnd = false
- this.page = 1
- this.getList()
- },
- methods: {
- doSearch() {
- this.isEnd = false
- this.page = 1
- this.getList()
- },
- //获取列表信息
- getList() {
- if (this.isEnd) {
- return
- }
- uni.showLoading({
- title: '加载中'
- })
- let data = {
- pageNum: this.page,
- size: this.size,
- type: 1,
- name: this.searchVal
- }
- getTableList(data).then(res => {
- if (this.page === 1) {
- this.tableList = res.list
- } else {
- this.tableList.push(...res.list)
- }
- this.page += 1
- this.isEnd = this.tableList.length >= res.count
- }).then(() => {
- uni.hideLoading()
- })
- },
- add() {
- uni.navigateTo({
- url: '/pages/saleManage/businessOpportunity/add'
- })
- },
- view() {
- },
- del(item) {
- deleteInformation([item.id]).then(res => {
- this.isEnd = false
- this.page = 1
- this.$refs.uToast.show({
- type: "success",
- message: "操作成功",
- })
- this.getList(this.where)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .add {
- width: 96rpx;
- height: 96rpx;
- border-radius: 48rpx;
- background: #3c9cff;
- position: fixed;
- bottom: 100rpx;
- right: 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .top-wrapper {
- background-color: #fff;
- display: flex;
- width: 750rpx;
- height: 88rpx;
- padding: 16rpx 32rpx;
- align-items: center;
- gap: 16rpx;
- /deep/.uni-section {
- margin-top: 0px;
- }
- /deep/.uni-section-header {
- padding: 0px;
- }
- .search_btn {
- width: 120rpx;
- height: 70rpx;
- line-height: 70rpx;
- padding: 0 24rpx;
- background: $theme-color;
- font-size: 32rpx;
- color: #fff;
- margin: 0;
- margin-left: 26rpx;
- }
- .menu_icon {
- width: 44rpx;
- height: 44rpx;
- margin-left: 14rpx;
- }
- }
- </style>
|