procure-list.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <div class="filter-control">
  5. <span style="width: auto;">机构名称:</span>
  6. <el-input
  7. v-model="listQuery.userName"
  8. placeholder="请输入机构名称"
  9. clearable
  10. @keyup.enter.native="getList"
  11. @clear="getList"
  12. />
  13. </div>
  14. <div class="filter-control">
  15. <span style="width: auto;">联系人:</span>
  16. <el-input
  17. v-model="listQuery.linkMan"
  18. placeholder="请输入联系人姓名"
  19. clearable
  20. @keyup.enter.native="getList"
  21. @clear="getList"
  22. />
  23. </div>
  24. <div class="filter-control">
  25. <span style="width: auto;">手机号:</span>
  26. <el-input
  27. v-model="listQuery.bindMobile"
  28. placeholder="请输入手机号"
  29. clearable
  30. @keyup.enter.native="getList"
  31. @clear="getList"
  32. />
  33. </div>
  34. <div class="filter-control">
  35. <span style="width: auto;">状态:</span>
  36. <el-select v-model="listQuery.clubStatus" style="width:120px;" clearable @change="getList">
  37. <el-option value="" label="全部" />
  38. <el-option label="待审核" :value="1" />
  39. <el-option label="已上线" :value="90" />
  40. <el-option label="已上线" :value="91" />
  41. <el-option label="审核未通过" :value="92" />
  42. </el-select>
  43. </div>
  44. <div class="filter-control">
  45. <span style="width: auto;">绑定微信:</span>
  46. <el-select v-model="listQuery.clubStatus" style="width:120px;" clearable @change="getList">
  47. <el-option value="" label="全部" />
  48. <el-option label="待审核" :value="1" />
  49. <el-option label="已上线" :value="90" />
  50. <el-option label="已上线" :value="91" />
  51. <el-option label="审核未通过" :value="92" />
  52. </el-select>
  53. </div>
  54. <div class="filter-control">
  55. <span>添加时间:</span>
  56. <el-date-picker
  57. v-model="registTime"
  58. type="daterange"
  59. unlink-panels
  60. range-separator="至"
  61. start-placeholder="开始日期"
  62. end-placeholder="结束日期"
  63. :picker-options="pickerOptions"
  64. @change="getList"
  65. />
  66. </div>
  67. <div class="filter-control">
  68. <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
  69. <el-button type="primary" icon="el-icon-plus" @click="handleProcureEdit(1)">添加采购员</el-button>
  70. </div>
  71. </div>
  72. <el-table
  73. v-loading="listLoading"
  74. :data="list"
  75. element-loading-text="Loading"
  76. border
  77. fit
  78. highlight-current-row
  79. :header-cell-style="{background:'#eef1f6',color:'#606266'}"
  80. >
  81. <el-table-column label="姓名" align="center" prop="name" />
  82. <el-table-column label="手机号" align="center" prop="mobile" width="150" />
  83. <el-table-column label="关联机构" align="center" prop="clubNames">
  84. <template slot-scope="{row}">
  85. <p v-for="(club,index) in row.clubNames" :key="index" style="margin: 2px 0;">{{ club }}</p>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="状态" align="center" prop="status" width="150">
  89. <template slot-scope="{row}">
  90. <el-tag v-if="row.status*1===90" type="success" size="small">已上线</el-tag>
  91. <el-tag v-else type="danger" size="small">已下线</el-tag>
  92. <el-button v-if="row.status*1 === 90" type="primary" size="mini" @click="handOffline(row)">下线</el-button>
  93. <el-button v-else type="primary" size="mini" @click="handOnline(row)">上线</el-button>
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="center" label="添加时间" prop="addTime">
  97. <template slot-scope="{row}">
  98. <span>{{ row.addTime }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="操作" align="center">
  102. <template slot-scope="{row}">
  103. <el-button type="primary" size="mini" @click="handleProcureEdit(2,row)">编辑</el-button>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <pagination v-show="total>10" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
  108. <template>
  109. <el-backtop style="right: 40px; bottom: 40px;">
  110. <i class="el-icon-upload2" />
  111. </el-backtop>
  112. </template>
  113. </div>
  114. </template>
  115. <script>
  116. import { findProcureList, setStatus, clubAudit } from '@/api/club'
  117. import pickerOptions from '@/utils/time-picker.js'
  118. export default {
  119. data() {
  120. return {
  121. registTime: '',
  122. pickerOptions,
  123. list: [],
  124. listLoading: true,
  125. total: 0,
  126. listQuery: {
  127. pageNum: 1,
  128. pageSize: 10,
  129. mobile: '',
  130. organizeId: this.$store.getters.organizeId,
  131. name: '',
  132. status: '',
  133. startTime: '',
  134. endTime: ''
  135. },
  136. auditPeople: {
  137. auditStatus: '',
  138. auditNote: '',
  139. userOrganizeId: this.$store.getters.organizeId,
  140. clubId: '',
  141. userId: '',
  142. clubs: []
  143. },
  144. updateTemp: {},
  145. updateTatusType: '',
  146. dialogVisible: false,
  147. dialogVisibleText: '',
  148. dialogFormVisible: true,
  149. dialogStatus: '',
  150. loadingbut: false,
  151. rules: {
  152. // organizeType: [{ required: true, message: '请选择机构类型', trigger: 'blur' }],
  153. auditStatus: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],
  154. auditNote: [{ required: true, message: '请填写原因', trigger: 'blur' }]
  155. }
  156. }
  157. },
  158. computed: {
  159. disabled() {
  160. return !this.addPeople.status
  161. },
  162. organizeId() {
  163. return this.$store.getters.organizeId
  164. }
  165. },
  166. created() {
  167. this.getList()
  168. },
  169. methods: {
  170. initTime() {
  171. // 初始化获取时间筛选值
  172. if (this.registTime && this.registTime.length > 0) {
  173. this.listQuery.startTime = this.registTime[0]
  174. this.listQuery.endTime = this.registTime[1]
  175. } else {
  176. this.listQuery.startTime = ''
  177. this.listQuery.endTime = ''
  178. }
  179. },
  180. async getList() {
  181. this.listLoading = true
  182. try {
  183. this.initTime()
  184. const res = await findProcureList(this.listQuery)
  185. this.list = res.data.results
  186. this.total = res.data.totalRecord
  187. this.listLoading = false
  188. } catch (error) {
  189. console.log('error', error)
  190. this.listLoading = false
  191. }
  192. },
  193. hanleVerify(row) {
  194. // 审核
  195. this.auditPeople.userId = row.userId
  196. this.auditPeople.clubId = row.clubId
  197. this.dialogFormVisible = true
  198. },
  199. handleEdit(row) { // 添加运营
  200. },
  201. handleCreateOperator() { // 确认审核
  202. this.$refs['dataForm'].validate((valid) => {
  203. if (valid) {
  204. this.clubAudit(this.auditPeople)
  205. } else {
  206. return false
  207. }
  208. })
  209. },
  210. // 审核
  211. async clubAudit(params) {
  212. try {
  213. await clubAudit(params)
  214. this.$message.success('操作成功')
  215. this.getList()
  216. this.dialogFormVisible = false
  217. } catch (error) {
  218. console.log('error', error)
  219. }
  220. },
  221. handOnline(row) {
  222. this.$confirm('确定上线该采购员吗?上线后采购员可以使用微信直接登录小程序', '系统提示', {
  223. confirmButtonText: '确定',
  224. cancelButtonText: '取消',
  225. type: 'warning'
  226. }).then(() => {
  227. const params = { serviceProviderId: row.serviceProviderId, status: 90 }
  228. this.updateClubStatus(params)
  229. }).catch(() => {
  230. })
  231. },
  232. handOffline(row) {
  233. this.$confirm('确定下线该采购员吗?下线后采购员将不能登录小程序。', '系统提示', {
  234. confirmButtonText: '确定',
  235. cancelButtonText: '取消',
  236. type: 'warning'
  237. }).then(() => {
  238. const params = { serviceProviderId: row.serviceProviderId, status: 91 }
  239. this.updateClubStatus(params)
  240. }).catch(() => {
  241. })
  242. },
  243. async updateClubStatus(params) {
  244. try {
  245. const res = await setStatus(params)
  246. this.$message.success(res.msg)
  247. this.getList()
  248. } catch (error) {
  249. this.$message.error(error.msg)
  250. }
  251. },
  252. handleProcureEdit(type, row) {
  253. switch (type) {
  254. case 1:
  255. this.$router.push({ path: '/procure/edit', query: { type: 'add' }})
  256. break
  257. case 2:
  258. this.$router.push({ path: '/procure/edit', query: { type: 'edit', id: row.serviceProviderId }})
  259. break
  260. }
  261. }
  262. }
  263. }
  264. </script>
  265. <style scoped>
  266. .el-dialog{
  267. width: 600px;
  268. }
  269. </style>