浏览代码

丽格1.0.1版本封存

zhengjinyi 2 年之前
父节点
当前提交
40f9045742

+ 2 - 2
.env.development

@@ -3,9 +3,9 @@ ENV = 'development'
 
 # base api
 # VUE_APP_BASE_API = '/dev-api'
-# VUE_APP_BASE_API = 'http://192.168.1.22:9104'
+VUE_APP_BASE_API = 'http://192.168.2.102:9104'
 # VUE_APP_BASE_API = 'http://192.168.2.67:9104'
-VUE_APP_BASE_API = 'https://mai-b.caimei365.com'
+# VUE_APP_BASE_API = 'https://mai-b.caimei365.com'
 # VUE_APP_BASE_API = 'http://192.168.78.1:9104/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

+ 49 - 1
src/api/club.js

@@ -112,4 +112,52 @@ export function unbindOperator(query) {
     params: query
   })
 }
-
+/**
+ *采购员列表
+ */
+export function findProcureList(query) {
+  return request({
+    url: '/user/cmOperationUser/findProcureList',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *未绑定采购员机构列表
+ */
+export function getClubEchoList(query) {
+  return request({
+    url: '/user/cmOperationUser/getClubEchoList',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *保存运营
+ */
+export function saveProcure(data) {
+  return request({
+    url: '/user/cmOperationUser/saveProcure',
+    method: 'post',
+    data
+  })
+}
+/**
+ *采购员编辑回显
+ */
+export function detailsEcho(id) {
+  return request({
+    url: '/user/cmOperationUser/detailsEcho/' + id,
+    method: 'get'
+  })
+}
+/**
+ *采购员上下线
+ */
+export function setStatus(query) {
+  return request({
+    url: '/user/cmOperationUser/setStatus',
+    method: 'get',
+    params: query
+  })
+}

+ 2 - 2
src/router/index.js

@@ -8,7 +8,7 @@ import Layout from '@/layout'
 
 /* Router Modules */
 import clubRouter from './modules/club'
-// import procureRouter from './modules/procure'
+import procureRouter from './modules/procure'
 import centralizedRouter from './modules/centralized'
 import floorRouter from './modules/floor'
 import goodsRouter from './modules/goods'
@@ -69,7 +69,7 @@ export const constantRoutes = [
  */
 export const asyncRoutes = [
   clubRouter,
-  // procureRouter,
+  procureRouter,
   centralizedRouter,
   goodsRouter,
   campaign,

+ 1 - 1
src/router/modules/procure.js

@@ -19,7 +19,7 @@ const procureRouter = {
       path: 'edit',
       name: 'ProcureEdit',
       component: () => import('@/views/club/procure-edit'),
-      meta: { title: '添加采购员', icon: 'ma-club-form' },
+      meta: { title: '添加采购员', noCache: true, icon: 'ma-club-form' },
       hidden: true
     }
   ]

+ 1 - 1
src/store/modules/permission.js

@@ -62,7 +62,7 @@ const actions = {
         const res = await getInfo(getToken())
         const data = res.data
         if (data.personnelType === 1) {
-          accessedRoutes[7].children.unshift({
+          accessedRoutes[8].children.unshift({
             path: 'user',
             name: 'User',
             component: () => import('@/views/sys/user-list'),

+ 10 - 23
src/views/club/components/club-multi-dialog.vue

@@ -10,26 +10,16 @@
       <div class="filter-control">
         <span>机构名称:</span>
         <el-input
-          v-model="listQuery.userName"
+          v-model="listQuery.name"
           placeholder="请输入机构名称"
           clearable
           @input="e => (listQuery.productName= checkedInput(e,2))"
         />
       </div>
-      <div class="filter-control">
-        <span style="width: auto;">状态:</span>
-        <el-select v-model="listQuery.clubStatus" style="width:120px;" clearable @change="getList">
-          <el-option value="" label="全部" />
-          <el-option label="待审核" :value="1" />
-          <el-option label="已上线" :value="90" />
-          <el-option label="已上线" :value="91" />
-          <el-option label="审核未通过" :value="92" />
-        </el-select>
-      </div>
       <div class="filter-control">
         <span>手机号:</span>
         <el-input
-          v-model="listQuery.bindMobile"
+          v-model="listQuery.mobile"
           placeholder="请输入手机号"
           clearable
           style="width:160px;"
@@ -41,7 +31,7 @@
     </div>
     <el-table ref="table" v-loading="isLoading" :data="list" height="400px" border @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="50" />
-      <el-table-column prop="userName" label="机构名称" align="center" />
+      <el-table-column prop="name" label="机构名称" align="center" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="{row}">
           <template v-if="row.clubStatus*1===1">
@@ -57,14 +47,14 @@
         </template>
       </el-table-column>
       <el-table-column label="联系人" align="center" prop="linkMan" />
-      <el-table-column label="手机号" align="center" prop="bindMobile" />
+      <el-table-column label="手机号" align="center" prop="contractMobile" />
     </el-table>
     <!-- 页码 -->
     <pagination
       :total="total"
       :page-sizes="[10]"
       :page-size="10"
-      :page.sync="listQuery.index"
+      :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
       @pagination="getList"
     />
@@ -76,7 +66,7 @@
 </template>
 
 <script>
-import { getClubList } from '@/api/club'
+import { getClubEchoList } from '@/api/club'
 
 export default {
   name: 'ProDialog',
@@ -90,14 +80,11 @@ export default {
     return {
       visible: true,
       listQuery: {
-        index: 1,
+        pageNum: 1,
         pageSize: 10,
         userOrganizeId: this.$store.getters.organizeId,
-        userName: '',
-        linkMan: '',
-        bindMobile: '',
-        startTime: '',
-        endTime: ''
+        name: '',
+        mobile: ''
       },
       list: [],
       total: 0,
@@ -117,7 +104,7 @@ export default {
     // 商品列表
     async getList() {
       this.isLoading = true
-      const res = await getClubList(this.listQuery)
+      const res = await getClubEchoList(this.listQuery)
       const data = res.data.results
       this.list = data.map(item => { item.sort = 0; return item })
       this.total = res.data.totalRecord

+ 5 - 5
src/views/club/list.vue

@@ -62,7 +62,7 @@
           </span>
         </template>
       </el-table-column>
-      <!-- <el-table-column label="采购员" align="center" prop="linkMan" /> -->
+      <el-table-column label="采购员" align="center" prop="spName" />
       <el-table-column label="状态" align="center" prop="status">
         <template slot-scope="{row}">
           <template v-if="row.clubStatus*1===1">
@@ -88,9 +88,9 @@
       <el-table-column label="审核时间" align="center" prop="auditTime" width="100" />
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="handleRecordDetail(1,row)">查看资料</el-button>
-          <!-- <el-button type="primary" size="mini" @click="handleRecordDetail(2,row)">查看运营人员</el-button> -->
-          <el-button v-if="row.clubStatus*1 === 1" type="warning" size="mini" @click="hanleVerify(row)">审核</el-button>
+          <el-button type="primary" size="mini" style="margin:5px;" @click="handleRecordDetail(1,row)">查看资料</el-button>
+          <el-button type="primary" size="mini" style="margin:5px;" @click="handleRecordDetail(2,row)">运营人员</el-button>
+          <el-button v-if="row.clubStatus*1 === 1" type="warning" size="mini" style="margin:5px;" @click="hanleVerify(row)">审核</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -281,7 +281,7 @@ export default {
         1: '/club/details',
         2: '/club/operateList'
       }
-      this.$router.push({ path: map[type], query: { clubId: row.clubId, userId: row.userId, name: row.userName }})
+      this.$router.push({ path: map[type], query: { clubId: row.clubId, name: row.userName }})
     }
   }
 }

+ 16 - 211
src/views/club/operateList.vue

@@ -28,43 +28,15 @@
     >
       <el-table-column label="姓名" align="center" prop="linkName" />
       <el-table-column label="手机号码" align="center" prop="mobile" />
-      <el-table-column class-name="status-col" label="微信绑定状态" align="center" prop="status">
-        <template slot-scope="{row}">
-          <i v-if="row.status === '2'" class="el-icon-success" style="color:#67C23A;font-size: 18px;" />
-          <!-- <i v-else class="el-icon-error" style="color: #E6A23C;font-size: 20px;" /> -->
-        </template>
-      </el-table-column>
       <el-table-column align="center" label="绑定时间" prop="bindTime">
         <template slot-scope="{row}">
           <span v-if="row.bindTime">{{ row.bindTime }}</span>
-          <span v-else>----</span>
+          <span v-else>暂未绑定</span>
         </template>
       </el-table-column>
+      <el-table-column align="center" label="添加时间" prop="addTime" />
     </el-table>
-    <pagination v-show="total>20" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="initOperatorListData" />
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="440px">
-      <el-form ref="dataForm" :rules="rules" :model="editTemp" label-position="left" label-width="70px" style="width: 400px;">
-        <el-form-item label="姓名" prop="linkName">
-          <el-input v-model="editTemp.linkName" placeholder="请输入姓名" maxlength="11" />
-        </el-form-item>
-        <el-form-item label="手机号" prop="mobile">
-          <el-input v-model="editTemp.mobile" placeholder="请输入手机号" maxlength="11" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">取消</el-button>
-        <el-button type="primary" :loading="loadingbut" @click="handleCreateOperator()">{{ loadingbuttext }}</el-button>
-        <el-button v-if="dialogStatus === 'add'" type="primary" @click="handlePreservOperator()">保存生成邀请码</el-button>
-      </div>
-    </el-dialog>
-
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogVisible" width="20%">
-      <span>{{ dialogVisibleText }}</span>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" :loading="loadingbut" @click="handleConfirm()">{{ loadingbuttext }}</el-button>
-      </span>
-    </el-dialog>
+    <pagination v-show="total>20" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
     <template>
       <el-backtop style="right: 40px; bottom: 40px;">
         <i class="el-icon-upload2" />
@@ -74,20 +46,11 @@
 </template>
 
 <script>
-import { getOperatorList, updateOperatorCode, unbindOperator, preservOperator } from '@/api/club'
+import { getOperatorList } from '@/api/club'
 import Pagination from '@/components/Pagination'
 
 export default {
   components: { Pagination },
-  filters: {
-    statusFilter(status) {
-      const statusMap = {
-        1: 'success',
-        0: 'gray'
-      }
-      return statusMap[status]
-    }
-  },
   data() {
     return {
       pageNum: 0,
@@ -95,50 +58,12 @@ export default {
       clubTitle: this.$route.query.name,
       listLoading: true,
       total: 0,
-      dialogVisible: false,
-      dialogVisibleText: '',
-      handleConfirmType: '',
       listQuery: {
-        index: 1,
+        pageNum: 1,
         pageSize: 20,
-        clubID: this.$route.query.clubId,
-        userID: this.$route.query.userId,
-        userorganizeId: this.$store.getters.organizeId,
-        linkName: '',
-        mobile: '',
-        status: '',
-        beginAddTime: '',
-        endAddTime: ''
-      },
-      editTemp: {
-        userorganizeId: this.$store.getters.organizeId,
+        clubId: this.$route.query.clubId,
         linkName: '',
         mobile: ''
-      },
-      codeRemp: {},
-      dialogFormVisible: false,
-      dialogFormVisibles: false,
-      dialogStatus: '',
-      loadingbut: false,
-      loadingbuttext: '确定',
-      textMap: {
-        add: '添加运营人员',
-        edit: '编辑运营人员',
-        update: '提示',
-        untying: '解绑',
-        generate: '生成邀请码',
-        updateCode: '更新邀请码'
-      },
-      rules: {
-        linkName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-        mobile: [
-          { required: true, message: '手机号不能为空', trigger: 'blur' },
-          {
-            required: true,
-            pattern: /^\d{11}|\d{13}$/,
-            message: '手机号格式不正确',
-            trigger: 'blur'
-          }]
       }
     }
   },
@@ -148,142 +73,22 @@ export default {
     }
   },
   created() {
-    this.initOperatorListData()
+    this.getList()
   },
   methods: {
-    initOperatorListData() {
+    async getList() {
       this.listLoading = true
-      getOperatorList(this.listQuery).then(response => {
-        const operatorListPage = response.data
-        this.pageNum = operatorListPage.index
-        this.list = operatorListPage.results
-        this.total = operatorListPage.totalRecord
+      try {
+        const res = await getOperatorList(this.listQuery)
+        const data = res.data
+        this.pageNum = data.index
+        this.list = data.results
+        this.total = data.totalRecord
+        this.listLoading = false
+      } catch (error) {
         this.listLoading = false
-      })
-    },
-    handleGenerateCode(row) {
-      this.dialogVisible = true
-      if (row.invitationCode) {
-        this.dialogStatus = 'updateCode'
-        this.dialogVisibleText = '确定生成邀请码吗?生成后将会短信通知该运营人员。'
-      } else {
-        this.dialogStatus = 'generate'
-        this.dialogVisibleText = '确定生成邀请码吗?生成后将会短信通知该运营人员。'
-      }
-      this.handleConfirmType = 'generate'
-      this.codeRemp = {
-        id: row.id,
-        clubID: row.clubID,
-        userID: row.userID,
-        userorganizeId: this.$store.getters.organizeId
-      }
-    },
-    handleConfirm() {
-      switch (this.handleConfirmType) {
-        case 'untying':
-          this.unbindOperators()
-          break
-        case 'generate':
-          this.generateRequst()
-          break
       }
     },
-    generateRequst() {
-      const params = this.codeRemp
-      this.loadingbut = true
-      this.loadingbuttext = '请稍候...'
-      updateOperatorCode(params).then(response => {
-        this.$message({ message: response.msg, type: 'success', center: true })
-        this.loadingbut = false
-        this.loadingbuttext = '确定'
-        this.dialogVisible = false
-        setTimeout(() => {
-          this.initOperatorListData()
-        }, 1000)
-      })
-    },
-    handleUntying(row) {
-      this.dialogVisible = true
-      this.dialogStatus = 'untying'
-      this.dialogVisibleText = '确定解绑该运营人员吗?'
-      this.handleConfirmType = 'untying'
-      this.editTemp = { userorganizeId: this.$store.getters.organizeId, id: row.id, userId: row.clubId, userID: row.userID }
-    },
-    unbindOperators() {
-      const params = this.editTemp
-      this.loadingbut = true
-      this.loadingbuttext = '解绑中...'
-      unbindOperator(params).then(response => {
-        this.$message({ message: response.msg, type: 'success', center: true })
-        this.dialogVisible = false
-        this.loadingbut = false
-        this.loadingbuttext = '确定'
-        setTimeout(() => {
-          this.initOperatorListData()
-        }, 1000)
-      })
-    },
-    bindAddPeople() { // 添加运营人员
-      this.loadingbuttext = '保存'
-      const addTemp = { clubID: this.listQuery.clubID, userID: this.listQuery.userID }
-      this.editTemp = Object.assign({}, addTemp)
-      console.log(this.editTemp)
-      this.dialogStatus = 'add'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-      })
-    },
-    handleEdit(row) { // 编辑
-      this.loadingbuttext = '保存'
-      const rowTemp = { id: row.id, clubID: row.clubID, userID: row.userID, linkName: row.linkName, mobile: row.mobile }
-      this.editTemp = Object.assign({}, rowTemp)
-      console.log(this.editTemp)
-      this.dialogStatus = 'edit'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-      })
-    },
-    handleCreateOperator() { // 保存
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          const params = Object.assign({ userorganizeId: this.$store.getters.organizeId, configFlag: 1 }, this.editTemp)
-          this.loadingbut = true
-          this.loadingbuttext = '保存中...'
-          preservOperator(params).then(response => {
-            this.$message({ message: response.msg, type: 'success', center: true })
-            this.dialogFormVisible = false
-            this.loadingbut = false
-            this.loadingbuttext = '确定'
-            setTimeout(() => {
-              this.initOperatorListData()
-            }, 3000)
-          }).catch(() => {
-            this.loadingbut = false
-            this.loadingbuttext = '保存'
-          })
-        }
-      })
-    },
-    handlePreservOperator() { // 保存并生成邀请码
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          const Formobj = { userorganizeId: this.$store.getters.organizeId, configFlag: 2 }
-          const params = Object.assign(Formobj, this.editTemp)
-          preservOperator(params).then(response => {
-            this.dialogFormVisible = false
-            this.$message({ message: response.msg, type: 'success', center: true })
-            setTimeout(() => {
-              this.initOperatorListData()
-            }, 1000)
-          })
-        }
-      })
-    },
-    handleFilter() {
-      this.initOperatorListData()
-    },
     rexpStautsText(status) {
       let text = ''
       switch (status) {

+ 68 - 80
src/views/club/procure-edit.vue

@@ -1,60 +1,58 @@
 <template>
   <div class="app-container" style="width: 800px;margin: 0 auto;">
-    <el-form ref="bannerForm" :model="form" label-width="100px">
+    <el-form ref="procureForm" :model="form" label-width="100px">
       <el-form-item label="姓名:" prop="name" :rules="rules.name">
         <el-input v-model="form.name" placeholder="请填写姓名" maxlength="6" style="width: 200px;" />
       </el-form-item>
       <el-form-item label="手机号:" prop="mobile" :rules="rules.mobile">
-        <el-input v-model="form.mobile" placeholder="请填写手机号" style="width: 200px" />
+        <el-input v-model="form.mobile" placeholder="请填写手机号" maxlength="11" style="width: 200px" />
       </el-form-item>
       <el-form-item label="状态:" prop="status" :rules="rules.status">
         <el-select v-model="form.status" placeholder="请选择">
-          <el-option label="上线" :value="1" />
-          <el-option label="下线" :value="0" />
+          <el-option label="上线" :value="90" />
+          <el-option label="下线" :value="91" />
         </el-select>
       </el-form-item>
-      <el-form-item label="关联机构:" prop="clubs" :rules="rules.clubs">
-        <template v-if="form.clubs && form.clubs.length === 0">
-          <el-button type="primary" autofocussize="mini" size="mini" icon="el-icon-plus" @click="handleDialogVisible">选择机构</el-button>
-          <el-checkbox-group v-show="false" v-model="form.clubs" />
-        </template>
-        <template v-else>
-          <el-table :data="form.clubs" border width="1000">
-            <el-table-column prop="userName" label="机构名称" align="center" />
-            <el-table-column label="状态" align="center" prop="status">
-              <template slot-scope="{row}">
-                <template v-if="row.clubStatus*1===1">
-                  <el-tag type="warning" size="small">待审核</el-tag>
-                </template>
-                <template v-else-if="row.clubStatus*1===92">
-                  <el-tag type="danger" size="small">审核未通过</el-tag>
-                </template>
-                <template v-else>
-                  <el-tag v-if="row.clubStatus*1===91" type="danger" size="small">已下线</el-tag>
-                  <el-tag v-else type="success" size="small">已上线</el-tag>
-                </template>
+      <el-form-item label="关联机构:" prop="clubList" :rules="rules.clubList">
+        <el-button type="primary" autofocussize="mini" size="mini" icon="el-icon-plus" @click="handleDialogVisible">选择机构</el-button>
+        <el-checkbox-group v-show="false" v-model="form.clubList" />
+        <el-table :data="form.clubList" border width="1000">
+          <el-table-column prop="name" label="机构名称" align="center" />
+          <el-table-column label="状态" align="center" prop="status">
+            <template slot-scope="{row}">
+              <template v-if="row.clubStatus*1===1">
+                <el-tag type="warning" size="small">待审核</el-tag>
               </template>
-            </el-table-column>
-            <el-table-column label="联系人" align="center" prop="linkMan" />
-            <el-table-column label="手机号" align="center" prop="bindMobile" />
-            <el-table-column label="操作" align="center">
-              <el-button type="text" @click="deleteShop">删除</el-button>
-            </el-table-column>
-          </el-table>
-        </template>
+              <template v-else-if="row.clubStatus*1===92">
+                <el-tag type="danger" size="small">审核未通过</el-tag>
+              </template>
+              <template v-else>
+                <el-tag v-if="row.clubStatus*1===91" type="danger" size="small">已下线</el-tag>
+                <el-tag v-else type="success" size="small">已上线</el-tag>
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column label="联系人" align="center" prop="linkMan" />
+          <el-table-column label="手机号" align="center" prop="contractMobile" />
+          <el-table-column label="操作" align="center">
+            <template slot-scope="scope">
+              <el-button type="text" @click="handleDeleteClubs(scope.$index)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
       </el-form-item>
     </el-form>
     <div class="el-dialog__footer" style="text-align: center;">
-      <el-button type="primary" @click="onSubmit('bannerForm')">保存</el-button>
+      <el-button type="primary" @click="onSubmit('procureForm')">保存</el-button>
       <el-button plain @click="backToList">返回</el-button>
     </div>
     <!-- 商品弹框 -->
-    <club-dialog v-if="dialogVisible" ref="goodDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
+    <club-dialog v-if="dialogVisible" ref="clubDialog" @cancel="handleGoodCancel" @confirm="handleGoodConfirm" />
   </div>
 </template>
 
 <script>
-import { savePageBanner, formPageBanner } from '@/api/campaign'
+import { saveProcure, detailsEcho } from '@/api/club'
 import clubDialog from './components/club-multi-dialog'
 export default {
   name: 'ProcureEdit',
@@ -74,8 +72,8 @@ export default {
         organizeId: this.$store.getters.organizeId,
         name: '', // 采购员名称
         mobile: '', // 采购员手机号
-        status: 1, // 轮播上线状态
-        clubs: []
+        status: 90, // 上线状态
+        clubList: []
       }
     }
     return {
@@ -86,16 +84,10 @@ export default {
       dialogVisible: false,
       loadImgLoading: false,
       rules: {
-        bannerName: [{ required: true, message: '请填写轮播主题', trigger: 'blur' }],
-        bannerImage: [{ required: true, message: '请上传轮播图', trigger: 'blur' }],
-        clubs: [{ required: true, type: 'array', message: '请添加一个商品', trigger: ['change'] }],
+        name: [{ required: true, message: '请填写姓名', trigger: 'blur' }],
+        mobile: [{ required: true, message: '请填写手机号', trigger: 'blur' }],
+        clubList: [{ required: true, type: 'array', message: '请添加机构', trigger: ['change'] }],
         status: [{ required: true, message: '请选择状态', trigger: 'blur' }]
-      },
-      listQuery: {
-        index: 1,
-        pageSize: 100,
-        enabledStatus: 1,
-        organizeId: this.$store.getters.organizeId
       }
     }
   },
@@ -106,45 +98,34 @@ export default {
     this.editType = this.$route.query.type || 'edit'
     if (this.editType === 'edit') {
       console.log('edit')
-      // this.formPageBanner(this.$route.query.id)
+      this.detailsEcho(this.$route.query.id)
     }
   },
   methods: {
-    async formPageBanner(id) {
-      // 获取轮播图详情
+    // 获取采购员信息
+    async detailsEcho(id) {
       try {
-        const res = await formPageBanner(id)
+        const res = await detailsEcho(id)
         this.form = { ...this.form, ...res.data }
-        if (res.data.jumpType === 2) {
-          this.form.products = []
-        }
       } catch (error) {
         console.log('error', error)
       }
     },
-    changeGrop(value) {
-      console.log('value', value)
-    },
-    // 显示选择商品弹窗
+    // 显示选择机构弹窗
     handleDialogVisible() {
       this.dialogVisible = true
     },
-    handleGoodDialogVisible(index) {
-      // 显示选择商品弹窗
-      this.addIndex = index
-      this.dialogGoodVisible = true
-    },
-    deleteShop() {
-      // 清除商品
-      this.form.jumpProductId = ''
-      this.form.clubs = []
+    // 删除机构
+    handleDeleteClubs(index) {
+      this.form.clubList.splice(index, 1)
     },
+    // 确认选择机构
     handleGoodConfirm(data) {
-      // 确认选择商品
-      this.form.clubs = data
-      console.log('clubs', this.form.clubs)
+      this.form.clubList = this.form.clubList.concat(data)
+      console.log('clubList', this.form.clubList)
       this.handleGoodCancel()
     },
+    // 提交
     onSubmit(formName) {
       this.$refs[formName].validate(valid => {
         if (valid) {
@@ -154,30 +135,37 @@ export default {
             type: 'warning'
           }).then(() => {
             console.log('form', this.form)
-            this.savePageBanner(this.form)
+            this.saveProcure(this.form)
           })
         } else {
           return false
         }
       })
     },
-    async savePageBanner(params) {
-      // 保存
-      await savePageBanner(params)
-      this.$message.success('保存成功')
-      setTimeout(() => {
-        this.$router.push({ path: '/campaign/list', query: { type: 1 }})
-      }, 1000)
+    // 保存
+    async saveProcure(params) {
+      try {
+        const res = await saveProcure(params)
+        this.$message.success(res.msg)
+        setTimeout(() => {
+          this.$router.push({ path: '/procure/list', query: { type: 1 }})
+        }, 1000)
+      } catch (error) {
+        console.log('error', error)
+      }
     },
-    // 取消选择商品
+    // 取消选择机构
     handleGoodCancel() {
       this.dialogVisible = false
-      this.$refs.goodDialog.visible = false
+      this.$refs.clubDialog.visible = false
+    },
+    changeGrop(value) {
+      console.log('value', value)
     },
     backToList() {
       this.$store.dispatch('tagsView/delView', this.$route).then(() => {
         this.$nextTick(() => {
-          this.$router.replace({ path: '/procure/list', query: { type: 1 }})
+          this.$router.replace({ path: '/procure/list' })
         })
       })
     }

+ 26 - 47
src/views/club/procure-list.vue

@@ -66,7 +66,7 @@
       </div>
       <div class="filter-control">
         <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
-        <el-button type="primary" icon="el-icon-search" @click="handleProcureEdit(1)">添加采购员</el-button>
+        <el-button type="primary" icon="el-icon-plus" @click="handleProcureEdit(1)">添加采购员</el-button>
       </div>
     </div>
     <el-table
@@ -78,49 +78,33 @@
       highlight-current-row
       :header-cell-style="{background:'#eef1f6',color:'#606266'}"
     >
-      <el-table-column label="姓名" align="center" prop="userName" />
-      <el-table-column label="手机号" align="center" prop="bindMobile" width="150" />
-      <el-table-column label="关联机构" align="center" prop="userName" />
-      <el-table-column label="状态" align="center" prop="status" width="150">
-        <template slot-scope="{row}">
-          <template v-if="row.clubStatus*1===1">
-            <el-tag type="warning" size="small">待审核</el-tag>
-          </template>
-          <template v-else-if="row.clubStatus*1===92">
-            <el-tag type="danger" size="small">审核未通过</el-tag>
-          </template>
-          <template v-else>
-            <el-tag v-if="row.clubStatus*1===91" type="danger" size="small">已下线</el-tag>
-            <el-tag v-else type="success" size="small">已上线</el-tag>
-            <el-button v-if="row.clubStatus*1 === 91" type="primary" size="mini" @click="handOnline(row)">上线</el-button>
-            <el-button v-else type="primary" size="mini" @click="handOffline(row)">下线</el-button>
-          </template>
-        </template>
-      </el-table-column>
-      <el-table-column class-name="status-col" label="微信绑定状态" align="center" prop="status">
+      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column label="手机号" align="center" prop="mobile" width="150" />
+      <el-table-column label="关联机构" align="center" prop="clubNames">
         <template slot-scope="{row}">
-          <i v-if="row.status === '2'" class="el-icon-success" style="color:#67C23A;font-size: 18px;" />
-          <!-- <i v-else class="el-icon-error" style="color: #E6A23C;font-size: 20px;" /> -->
+          <p v-for="(club,index) in row.clubNames" :key="index" style="margin: 2px 0;">{{ club }}</p>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="添加时间" prop="registerTime">
+      <el-table-column label="状态" align="center" prop="status" width="150">
         <template slot-scope="{row}">
-          <span>{{ row.registerTime }}</span>
+          <el-tag v-if="row.status*1===90" type="success" size="small">已上线</el-tag>
+          <el-tag v-else type="danger" size="small">已下线</el-tag>
+          <el-button v-if="row.status*1 === 90" type="primary" size="mini" @click="handOffline(row)">下线</el-button>
+          <el-button v-else type="primary" size="mini" @click="handOnline(row)">上线</el-button>
         </template>
       </el-table-column>
-      <el-table-column align="center" label="绑定时间" prop="registerTime">
+      <el-table-column align="center" label="添加时间" prop="addTime">
         <template slot-scope="{row}">
-          <span>{{ row.registerTime }}</span>
+          <span>{{ row.addTime }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="{row}">
           <el-button type="primary" size="mini" @click="handleProcureEdit(2,row)">编辑</el-button>
-          <el-button type="primary" size="mini" @click="handleProcureEdit(2,row)">解除微信</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total>10" :total="total" :page.sync="listQuery.index" :limit.sync="listQuery.pageSize" @pagination="getList" />
+    <pagination v-show="total>10" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
     <template>
       <el-backtop style="right: 40px; bottom: 40px;">
         <i class="el-icon-upload2" />
@@ -130,7 +114,7 @@
 </template>
 
 <script>
-import { getClubList, updateStatus, clubAudit } from '@/api/club'
+import { findProcureList, setStatus, clubAudit } from '@/api/club'
 import pickerOptions from '@/utils/time-picker.js'
 export default {
   data() {
@@ -141,18 +125,15 @@ export default {
       listLoading: true,
       total: 0,
       listQuery: {
-        index: 1,
+        pageNum: 1,
         pageSize: 10,
-        userOrganizeId: this.$store.getters.organizeId,
-        userName: '',
-        linkMan: '',
-        bindMobile: '',
-        clubStatus: '',
+        mobile: '',
+        organizeId: this.$store.getters.organizeId,
+        name: '',
+        status: '',
         startTime: '',
         endTime: ''
       },
-      startTime: '',
-      endTime: '',
       auditPeople: {
         auditStatus: '',
         auditNote: '',
@@ -201,7 +182,7 @@ export default {
       this.listLoading = true
       try {
         this.initTime()
-        const res = await getClubList(this.listQuery)
+        const res = await findProcureList(this.listQuery)
         this.list = res.data.results
         this.total = res.data.totalRecord
         this.listLoading = false
@@ -240,32 +221,30 @@ export default {
       }
     },
     handOnline(row) {
-      this.updateTemp = Object.assign({}, { clubId: row.clubId, userId: row.userId, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
-      this.$confirm('确定上线该门店吗?上线后门店负责人可使用账号密码登录小程序。', '系统提示', {
+      this.$confirm('确定上线该采购员吗?上线后采购员可以使用微信直接登录小程序', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        const params = Object.assign({}, this.updateTemp)
+        const params = { serviceProviderId: row.serviceProviderId, status: 90 }
         this.updateClubStatus(params)
       }).catch(() => {
       })
     },
     handOffline(row) {
-      this.updateTemp = Object.assign({}, { clubId: row.clubId, userId: row.userId, clubStatus: row.clubStatus, userorganizeId: this.$store.getters.organizeId })
-      this.$confirm('确定下线该门店吗?下线后该门店将不能在小程序进行采购。', '系统提示', {
+      this.$confirm('确定下线该采购员吗?下线后采购员将不能登录小程序。', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        const params = Object.assign({}, this.updateTemp)
+        const params = { serviceProviderId: row.serviceProviderId, status: 91 }
         this.updateClubStatus(params)
       }).catch(() => {
       })
     },
     async updateClubStatus(params) {
       try {
-        const res = await updateStatus(params)
+        const res = await setStatus(params)
         this.$message.success(res.msg)
         this.getList()
       } catch (error) {
@@ -278,7 +257,7 @@ export default {
           this.$router.push({ path: '/procure/edit', query: { type: 'add' }})
           break
         case 2:
-          this.$router.push({ path: '/procure/edit', query: { type: 'edit', clubId: row.clubId, userId: row.userId, name: row.userName }})
+          this.$router.push({ path: '/procure/edit', query: { type: 'edit', id: row.serviceProviderId }})
           break
       }
     }

+ 11 - 9
src/views/finance/list.vue

@@ -36,14 +36,6 @@
           @clear="getList"
         />
       </div>
-      <!-- <div class="filter-control">
-        <span>订单类型:</span>
-        <el-select v-model="listQuery.status" style="width:180px;" clearable @change="getList">
-          <el-option value="" label="所有" />
-          <el-option label="采购员订单" value="99" />
-          <el-option label="自主订单" value="7" />
-        </el-select>
-      </div> -->
       <div class="filter-control">
         <span>机构名称:</span>
         <el-input
@@ -79,6 +71,14 @@
           <el-option label="已收款" :value="3" />
         </el-select>
       </div>
+      <div class="filter-control">
+        <span>订单类型:</span>
+        <el-select v-model="listQuery.orderType" style="width:180px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="采购员订单" :value="0" />
+          <el-option label="自主订单" :value="1" />
+        </el-select>
+      </div>
       <div class="filter-control">
         <span>收款时间:</span>
         <el-date-picker
@@ -142,6 +142,7 @@
     </el-table>
     <!-- 页码 -->
     <pagination
+      v-show="total>20"
       :total="total"
       :page-sizes="[20]"
       :page-size="20"
@@ -198,7 +199,8 @@ export default {
         receiptProgress: '', // 收款进度
         associationNum: '', // 关联数量
         startTime: '', // 下单开始时间
-        endTime: '' // 下单结束时间
+        endTime: '', // 下单结束时间
+        orderType: '' // 订单类型
       },
       receiptTypeList: []
     }

+ 8 - 8
src/views/order/list.vue

@@ -57,14 +57,6 @@
           @clear="getList"
         />
       </div>
-      <!-- <div class="filter-control">
-        <span>订单类型:</span>
-        <el-select v-model="listQuery.status" style="width:180px;" clearable @change="getList">
-          <el-option value="" label="所有" />
-          <el-option label="采购员订单" value="99" />
-          <el-option label="自主订单" value="7" />
-        </el-select>
-      </div> -->
       <div class="filter-control">
         <span>订单状态:</span>
         <el-select v-model="listQuery.status" style="width:180px;" clearable @change="getList">
@@ -120,6 +112,14 @@
           <el-option label="无" value="0" />
         </el-select>
       </div>
+      <div class="filter-control">
+        <span>订单类型:</span>
+        <el-select v-model="listQuery.orderType" style="width:180px;" clearable @change="getList">
+          <el-option value="" label="所有" />
+          <el-option label="采购员订单" :value="0" />
+          <el-option label="自主订单" :value="1" />
+        </el-select>
+      </div>
       <div class="filter-control">
         <span>下单时间:</span>
         <el-date-picker