zhangdan 4 lat temu
rodzic
commit
70fadd01cf

+ 60 - 0
src/api/collector.js

@@ -0,0 +1,60 @@
+import { axios } from '@/utils/request'
+
+// 获取采集员列表数据
+export const getCollectorList = params => {
+  const url = `gatherUser/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 重置密码
+export const resetPSD = params => {
+  return axios({
+    url: 'sleler/user/resetPwd',
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 改变权限状态接口
+export const updateEnableStatus = params => {
+  return axios({
+    url: `gatherUser/enable/${params.id}/${params.flag}`,
+    data: {},
+    method: 'get'
+  })
+}
+
+// 删除用户接口
+export const delectCollector= params => {
+  return axios({
+    url: `gatherUser/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+
+// 新增/编辑保存接口
+export const saveCollector = params => {
+  return axios({
+    url: 'gatherUser/save',
+    data: params,
+    method: 'POST'
+  })
+}
+
+// 编辑查详情
+export const slelerDetails = (params) => {
+  const url = `sleler/user/findById/${params.id}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'get'
+  })
+}
+

+ 24 - 22
src/views/equipmentManage/collector/addCollector.vue

@@ -2,13 +2,13 @@
   <a-modal :footer="null" centered :title="titleText" v-model="isShow" @cancle="cancel">
     <a-spin :spinning="loading">
       <a-form-model :model="formData" ref="ruleForm" :rules="rules">
-        <a-form-model-item label="网点标签" :label-col="{span:6}" :wrapper-col="{span:16}" prop="labelNoList">
+        <a-form-model-item label="网点标签" :label-col="{span:6}" :wrapper-col="{span:16}" prop="stationNo">
           <a-select
             style="max-height: 50px;overflow: auto;"
-            id="network-labelNoList"
+            id="network-stationNo"
             placeholder="请选择网点标签"
             allowClear
-            v-model="formData.labelNoList"
+            v-model="formData.stationNo"
             :showSearch="true"
             option-filter-prop="children"
             :filter-option="filterOption"
@@ -17,10 +17,10 @@
           </a-select>
         </a-form-model-item>
         <a-form-model-item label="采集员姓名" :label-col="{span:6}" :wrapper-col="{span:16}">
-          <a-input placeholder="请输入网点标签名称(30个字符以内)" v-model="formData.collectorName" allowClear :maxLength="30"/>
+          <a-input placeholder="请输入网点标签名称(30个字符以内)" v-model="formData.gatherName" allowClear :maxLength="30"/>
         </a-form-model-item>
-        <a-form-model-item label="采集员手机" :label-col="{span:6}" :wrapper-col="{span:16}" prop="collectorPhone">
-          <a-input placeholder="请输入采集员手机" v-model="formData.collectorPhone" allowClear :maxLength="11"/>
+        <a-form-model-item label="采集员手机" :label-col="{span:6}" :wrapper-col="{span:16}" prop="gatherPhone">
+          <a-input placeholder="请输入采集员手机" v-model="formData.gatherPhone" allowClear :maxLength="11" :disabled="collectorId ? true :false "/>
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 24, offset: 8 }">
           <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '15px' }">
@@ -36,7 +36,7 @@
 </template>
 
 <script>
-// import { lableDetails, saveLable } from '@/api/labelSetting.js'
+import { saveCollector } from '@/api/collector.js'
 import { lableSeleteList } from '@/api/labelSetting.js'
 export default {
   name: 'AddCollector',
@@ -52,12 +52,12 @@ export default {
   },
   data () {
     return {
-      formData: { collectorName: '', collectorPhone: '', labelNoList: undefined },
+      formData: { gatherName: '', gatherPhone: '', stationNo: undefined },
       isShow: this.openModal, // 弹框状态
       titleText: '新增',
       rules: {
-        labelNoList: [{ required: true, message: '请选择网点标签', trigger: 'change' }],
-        collectorPhone: [{ required: true, message: '请输入正确的手机号', trigger: 'blur' }]
+        stationNo: [{ required: true, message: '请选择网点标签', trigger: 'change' }],
+        gatherPhone: [{ required: true, message: '请输入正确的手机号', trigger: 'blur' }]
       },
       loading: false,
       lableData: [] // 标签数据
@@ -97,16 +97,17 @@ export default {
         const _this = this
         if (valid) {
           const params = JSON.parse(JSON.stringify(this.formData))
-          // saveLable(params).then(res => {
-          //   console.log(res, 'rrrrrrrrr')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$emit('refresh')
-          //     setTimeout(function () {
-          //       _this.cancel()
-          //     }, 300)
-          //   }
-          // })
+          params.id=_this.collectorId ? _this.collectorId : undefined
+          saveCollector(params).then(res => {
+            console.log(res, 'rrrrrrrrr')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            }
+          })
         }
       })
     },
@@ -117,8 +118,9 @@ export default {
     clear () {
       this.$refs.ruleForm.resetFields()
       delete this.formData.id
-      this.formData.macAddress = ''
-      this.formData.remarks = ''
+      this.formData.gatherPhone=''
+      this.formData.stationNo=''
+      this.formData.gatherName=''
     }
   },
   // 监听弹窗

+ 17 - 17
src/views/equipmentManage/collector/collector.vue

@@ -16,12 +16,12 @@
           </a-col>
           <a-col :xs="24" :sm="12" :md="8" :lg="6">
             <a-form-item label="网点名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-              <a-input id="network-queryWord" allowClear :maxLength="30" v-model="queryParam.queryWord" placeholder="请输入网点名称" />
+              <a-input id="network-stationNo" allowClear :maxLength="30" v-model="queryParam.stationNo" placeholder="请输入网点名称" />
             </a-form-item>
           </a-col>
           <a-col :xs="24" :sm="12" :md="8" :lg="6">
             <a-form-item label="采集员" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-              <a-input id="network-queryWord" allowClear :maxLength="30" v-model="queryParam.queryWord" placeholder="请输入姓名/手机号码" />
+              <a-input id="network-nameOrPhone" allowClear :maxLength="30" v-model="queryParam.nameOrPhone" placeholder="请输入姓名/手机号码" />
             </a-form-item>
           </a-col>
           <a-col :xs="24" :sm="12" :md="8" :lg="6">
@@ -76,7 +76,7 @@
 import { STable, VSelect } from '@/components'
 import moment from 'moment'
 import addCollector from './addCollector.vue'
-import { stationList } from '@/api/station'
+import { getCollectorList, resetPSD,updateEnableStatus,delectCollector} from '@/api/collector'
 export default {
   name: 'Collector',
   components: { STable, VSelect, addCollector },
@@ -88,24 +88,24 @@ export default {
       },
       // 查询参数
       queryParam: {
-        beginDate: null, // 开始时间
-        endDate: null, // 结束时间
-        queryWord: '', //  网点名称
-        labelNoList: []
+        registerregisterBeginDate: null, // 开始时间
+        registerregisterEndDate: null, // 结束时间
+        nameOrPhone: '', //  网点名称
+        stationNo: ''
       },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 200, align: 'center' },
-        { title: '网点名称', dataIndex: 'name', width: 200, align: 'center', customRender: text => { return text || '--' } },
-        { title: '采集员姓名', dataIndex: '', width: 150, align: 'center', ellipsis: true, customRender: text => { return text || '--' } },
-        { title: '采集员手机', dataIndex: '', width: 150, align: 'center', ellipsis: true, customRender: text => { return text || '--' } },
+        { title: '网点名称', dataIndex: 'stationNo', width: 200, align: 'center', customRender: text => { return text || '--' } },
+        { title: '采集员姓名', dataIndex: 'gatherName', width: 150, align: 'center', ellipsis: true, customRender: text => { return text || '--' } },
+        { title: '采集员手机', dataIndex: 'gatherPhone', width: 150, align: 'center', ellipsis: true, customRender: text => { return text || '--' } },
         { title: '状态', dataIndex: 'loginFlag', width: 100, align: 'center', slot: 'status' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return stationList(Object.assign(parameter, this.queryParam)).then(res => {
+        return getCollectorList(Object.assign(parameter, this.queryParam)).then(res => {
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             for (let i = 0; i < res.data.list.length; i++) {
@@ -132,8 +132,8 @@ export default {
     // 创建时间change
     onChange (dates, dateStrings) {
       if ((dates, dateStrings)) {
-        this.queryParam.beginDate = dateStrings[0]
-        this.queryParam.endDate = dateStrings[1]
+        this.queryParam.registerBeginDate = dateStrings[0]
+        this.queryParam.registerregisterEndDate = dateStrings[1]
       }
     },
     filterOption (input, option) {
@@ -143,13 +143,13 @@ export default {
     },
     // 重置
     handleReset () {
-      this.queryParam.beginDate = undefined
-      this.queryParam.endDate = undefined
-      this.queryParam.queryWord = ''
+      this.queryParam.registerBeginDate = undefined
+      this.queryParam.registerEndDate = undefined
+      this.queryParam.nameOrPhone = ''
       this.time = []
       this.$refs.table.refresh(true)
       this.networkId = undefined
-      this.queryParam.labelNoList = []
+      this.queryParam.stationNo = ''
     },
     //  新增、编辑网点
     handleEdit (row) {

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.16.220:8301/gc-admin/',
+        target: 'http://192.168.16.177:8301/gc-admin/',
         // target: 'https://lese.test.sxzxyj.net/gc-admin/',
         ws: false,
         changeOrigin: true,