ソースを参照

菜单路由配置

zhangdan 4 年 前
コミット
752d00dc02

+ 72 - 1
src/config/router.config.js

@@ -270,6 +270,67 @@ export const asyncRouterMap = [{
     }
     ]
   },
+  // 清运管理
+  {
+	  path: '/cleanManage',
+	  redirect: '/cleanManage/statisticalReport',
+	  component: PageView,
+	  meta: {
+	    title: '清运管理',
+	    icon: 'apartment'
+	  },
+	  children: [{
+	    path: '/cleanManage/statisticalReport',
+	    name: 'statisticalReport',
+	    component: () => import(/* webpackChunkName: "equipmentManage" */
+	      '@/views/cleanManage/statisticalReport.vue'),
+	    meta: {
+	      title: '统计报表',
+	      icon: 'bar-chart'
+	    }
+	  },
+	  {
+	    path: '/cleanManage/driverManage',
+	    name: 'driverManage',
+	    component: () => import(/* webpackChunkName: "equipmentManage" */
+	      '@/views/cleanManage/driverManage.vue'),
+	    meta: {
+	      title: '司机管理',
+	      icon: 'usb'
+	    }
+	  },
+	  {
+	    path: '/cleanManage/cleanDetail',
+	    name: 'cleanDetail',
+	    component: () => import(/* webpackChunkName: "equipmentManage" */
+	      '@/views/cleanManage/cleanDetail.vue'),
+	    meta: {
+	      title: '清运明细',
+	      icon: 'block'
+	    }
+	  },
+	  {
+	    path: '/cleanManage/netWorkCleanRecord',
+	    name: 'netWorkCleanRecord',
+	    component: () => import(/* webpackChunkName: "equipmentManage" */
+	      '@/views/cleanManage/netWorkCleanRecord.vue'),
+	    meta: {
+	      title: '网点清运记录',
+	      icon: 'build'
+	    }
+	  },
+	  {
+	    path: '/cleanManage/notCleanNetwork',
+	    name: 'notCleanNetwork',
+	    component: () => import(/* webpackChunkName: "equipmentManage" */
+	      '@/views/cleanManage/notCleanNetwork.vue'),
+	    meta: {
+	      title: '待清运网点',
+	      icon: 'dashboard'
+	    }
+	  }
+	  ]
+  },
   // 报表
   {
     path: '/reportForm',
@@ -380,11 +441,21 @@ export const asyncRouterMap = [{
       component: () => import(/* webpackChunkName: "equipmentManage" */
         '@/views/equipmentManage/equipment/equipment.vue'),
       meta: {
-        title: '设备管理',
+        title: '回收箱体管理',
         icon: 'usb',
         permission: 'M_equipment_list'
       }
     },
+    {
+	  path: '/equipmentManage/electronicScale',
+	  name: 'electronicScale',
+	  component: () => import(/* webpackChunkName: "equipmentManage" */
+	    '@/views/equipmentManage/electronicScale/electronicScale.vue'),
+	  meta: {
+	    title: '电子秤管理',
+	    icon: 'usb'
+	  }
+    },
     {
       path: '/equipmentManage/boxSetting',
       name: 'boxSetting',

+ 232 - 0
src/views/cleanManage/addDiverModal.vue

@@ -0,0 +1,232 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      width="60%"
+      :centered="true">
+      <a-form-model ref="ruleForm" :model="formData" :rules="rules" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+        <a-form-model-item label="司机姓名" props="name">
+          <a-input v-model.trim="formData.name" :maxLength="30" placeholder="请输入司机姓名(最多30个字符)"/>
+        </a-form-model-item>
+        <a-form-model-item label="手机号码" props="phone">
+          <a-input v-model.trim="formData.phone" @input="mobileInput" :maxLength="11" placeholder="请输入手机号"/>
+        </a-form-model-item>
+        <a-form-model-item label="状态" props="loginFlag"><a-radio-group
+          name="radioGroup"
+          v-model="formData.loginFlag"
+        >
+          <a-radio :value="1">是</a-radio>
+          <a-radio :value="0">否</a-radio>
+        </a-radio-group> </a-form-model-item>
+        <a-form-model-item label="" class="btn-cont" :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }">
+          <a-button type="primary" @click="onSubmit">保存</a-button>
+          <a-button @click="cancel">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  saveUserPower,
+  slelerDetails
+} from '@/api/userManage.js'
+export default {
+  name: 'AddDiverModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+	  // 校验手机号
+	  // const isMobileValid = (rule, value, callback) => {
+	  //   if (!value) {
+	  //     callback(new Error('请输入手机号'))
+	  //   } else {
+	  //     if (!isMobile(value)) {
+	  //       callback(new Error('请输入正确的手机号'))
+	  //     } else {
+	  //       callback()
+	  //     }
+	  //   }
+	  // }
+    return {
+      titleText: '新增',
+      isshow: this.visible,
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, {
+        name: 'ruleForm'
+      }),
+      optionData: [],
+      formData: {
+        name: '',
+        loginFlag: '', // 活动状态
+        phone: ''
+      },
+      rules: {
+        phone: [{
+          required: true,
+		  pattern: /^\d{11}$/,
+          message: '请输入手机号',
+          trigger: 'blur'
+        }],
+        name: [{
+          required: true,
+          message: '请输入司机姓名',
+          trigger: 'blur'
+        }],
+        loginFlag: [{
+          required: true,
+          message: '请选择状态',
+          trigger: 'blur'
+        }]
+      }
+    }
+  },
+  methods: {
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    handleChange (value) {
+      console.log(`selected ${value}`)
+    },
+    handleBlur () {
+      console.log('blur')
+    },
+    handleFocus () {
+      console.log('focus')
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    getPageInfo () {
+      slelerDetails({
+        id: this.itemId
+      }).then(res => {
+        if (res.status == 200) {
+          console.log(res, '-------------返回数据')
+          this.form.setFieldsValue({
+            'formData': res.data
+          })
+          // this.form.setFieldsValue({
+          //   'formData.loginFlag': Number(res.data.loginFlag)
+          // })
+          // this.form.setFieldsValue({ 'formData.name': res.data.name })
+          // this.form.setFieldsValue({ 'formData.phone': res.data.phone })
+          // this.form.setFieldsValue({ 'formData.sex': res.data.sex })
+          // this.form.setFieldsValue({ 'formData.org.name': res.data.org.name })
+          // this.form.setFieldsValue({ 'formData.remarks': res.data.remarks })
+        }
+      })
+    },
+    // 保存提交
+    onSubmit () {
+      // const _this = this
+      // this.$refs.ruleForm.validate(valid => {
+      //   if (!valid) {
+      //     const formData = Object.assign({}, this.formData, values.formData)
+      //     formData.id = _this.itemId
+      //     saveUserPower(formData).then(res => {
+      //       console.log(res, 'rrrrrrrrr')
+      //       if (res.status == 200) {
+      //         _this.$message.success(res.message)
+      //         _this.$emit('refresh')
+      //         setTimeout(function () {
+      //           _this.isshow = false
+      //         }, 300)
+      //       }
+      //     })
+      //   }
+      // })
+	  this.$refs.ruleForm.validate(valid => {
+	    if (valid) {
+	      const params = {
+			  name: this.formData.name,
+			  loginFlag: this.formData.loginFlag,
+			  phone: this.formData.phone
+	      }
+	      saveUserPower(params).then(res => {
+	        if (res.status == 200) {
+	          if (this.$hasPermissions('M_bundel_buyRecord')) {
+	            this.$router.push({ path: '/SetmealSales/PurchasedSetmeal' })
+	          } else {
+	            this.cancel()
+	          }
+	        }
+	      })
+	    } else {
+	      console.log('error submit!!')
+	      return false
+	    }
+	  })
+    },
+    // 取消
+    handleCancel () {
+      this.cancel()
+    },
+    clear () {
+      // this.form.resetFields()
+      delete this.formData.id
+      // this.formData.roleNames = []
+      this.formData.name = ''
+      this.formData.loginFlag = ''
+      this.formData.phone = ''
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'miniForm'
+    })
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (val) {
+      if (!val) {
+        this.$emit('close')
+      } else {
+        // this.form.resetFields()
+      }
+    },
+    itemId (newValue, oldValue) {
+      console.log(newValue, '----------id')
+      if (newValue && this.isshow) {
+        this.titleText = '编辑'
+        this.getPageInfo(newValue)
+      } else {
+        this.titleText = '新增'
+      }
+    }
+  }
+}
+</script>
+
+<style>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
+</style>

+ 8 - 0
src/views/cleanManage/cleanDetail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 241 - 0
src/views/cleanManage/driverManage.vue

@@ -0,0 +1,241 @@
+<template>
+  <a-card :bordered="false" class="userManage-page-info">
+    <!-- 搜索条件 -->
+    <div class="userManage-search">
+      <a-form-model layout="inline" :model="queryParam" v-bind="formItemLayout" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="24">
+          <a-col :xs="24" :sm="12" :md="6" :lg="5"><a-form-model-item label="司机姓名" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"><a-input allowClear placeholder="请输入司机姓名" v-model.trim="queryParam.name"/></a-form-model-item></a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="5"><a-form-model-item label="手机号码" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"><a-input allowClear placeholder="请输入手机号码" :maxLength="11" v-model.trim="queryParam.phone"/></a-form-model-item></a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="5"><a-form-model-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"><v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态" ></v-select></a-form-model-item></a-col>
+          <a-col :xs="24" :sm="12" :md="6" :lg="5">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="userList-handSubmit" style="margin: 4px 10px 0 20px">查询</a-button>
+            <a-button type="" @click="reset" id="userList-reset" style="margin-top: 4px">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 新增 -->
+    <div class="table-operator">
+      <a-button
+        type="primary"
+        icon="plus"
+        @click="openModal"
+        id="userList-openModal"
+        v-hasPermission="'B_userManage_add'"
+        style="margin-top: 18px;">新增</a-button>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <template slot="loginFlag" slot-scope="text, record">
+        <span :class="record.loginFlag == 0 ? 'red' : record.loginFlag == 1 ? 'green' :'' ">{{ record.loginFlag == 0 ? '禁用' :record.loginFlag == 1 ? '启用' : '--' }}</span>
+      </template>
+      <span slot="action" slot-scope="text, record">
+        <a-icon
+          type="unlock"
+          title="重置密码"
+          class="actionBtn icon-orange"
+          @click="resetPassword(record)" />
+        <a-icon
+          type="edit"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record)"
+        />
+        <a-icon
+          v-if="record.loginFlag == 0"
+          type="delete"
+          title="删除"
+          class="actionBtn icon-red"
+          @click="delect(record)"/>
+        <!-- <span v-if="!$hasPermissions('B_userManage_edit') && !($hasPermissions('B_userManage_resetPwd') && record.loginFlag==1) && !($hasPermissions('B_userManage_del') && record.loginFlag==0) ">--</span> -->
+      </span>
+    </s-table>
+    <!-- 新增、编辑弹窗 -->
+    <addDiverModal :visible="showModal" @refresh="$refs.table.refresh(true)" :itemId="itemId" @close="cancel"></addDiverModal>
+  </a-card>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import addDiverModal from './addDiverModal.vue'
+import { resetPSD, getPowerUserList, delectUserPower } from '@/api/userManage.js'
+export default {
+  name: 'DriverManage',
+  components: {
+    STable,
+    VSelect,
+    addDiverModal
+  },
+  data () {
+    return {
+      formItemLayout: {
+		  labelCol: {
+		    span: 7
+		  },
+		  wrapperCol: {
+		    span: 17
+		  }
+      },
+      // 查询参数
+      queryParam: {
+        name: '',
+        phone: '',
+        loginFlag: ''
+      },
+      showModal: false,
+      itemId: null, // 编辑行id
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '司机姓名',
+        dataIndex: 'createDate',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'name',
+        width: 100,
+        align: 'center'
+      },
+      {
+        title: '状态',
+        dataIndex: 'loginFlag',
+        width: 100,
+        align: 'center',
+        scopedSlots: {
+		  customRender: 'loginFlag'
+        }
+      },
+      {
+        title: '操作',
+        width: 100,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getPowerUserList(Object.assign(parameter, this.queryParam)).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+            _item.loginFlag = _item.loginFlag + '' === '1'
+          }
+          return res.data
+        })
+      }
+    }
+  },
+  // beforeRouteEnter (to, from, next) {
+  //   next(vm => {
+  //     vm.getSellerList()
+  //   })
+  // },
+  methods: {
+	  cancel () {
+	    this.itemId = null
+	    this.showModal = false
+	  },
+    // 刷新列表
+    refreshTable () {
+      this.$refs.table.refresh(true)
+    },
+    // 新建
+    openModal () {
+      this.showModal = true
+      this.itemData = {}
+    },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.phone = ''
+      this.queryParam.loginFlag = ''
+      this.refreshTable()
+    },
+    // 重置密码
+    resetPassword (row) {
+      resetPSD({
+        id: row.id
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+        }
+      })
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          delectUserPower({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    // getBizStr (storeBizList) {
+    //   const str = []
+    //   storeBizList.forEach(item => {
+    //     str.push(item.bizTypeName)
+    //   })
+    //   return str.join(',')
+    // },
+    handleEdit (row) {
+      console.log(row, 'row')
+	  this.itemId = row.id
+      this.showModal = true
+    }
+    // 修改状态
+    // changeFlagHandle (text, record) {
+    //   const _data = {
+    //     id: record.id,
+    //     flag: record.loginFlag ? '1' : '0'
+    //   }
+    //   updateEnableStatus(_data).then(res => {
+    //     if (res.status + '' === '200') {
+    //       this.$message.success(res.message)
+    //     } else {
+    //       record.loginFlag = !record.loginFlag
+    //     }
+    //   })
+    // }
+  }
+}
+</script>
+<style lang="less">
+	.userManage-page-info{
+		.userManage-search{
+			.ant-form-inline .ant-form-item {
+				width: 100%;
+			}
+		}
+	}
+</style>

+ 8 - 0
src/views/cleanManage/netWorkCleanRecord.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
src/views/cleanManage/notCleanNetwork.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
src/views/cleanManage/statisticalReport.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
src/views/equipmentManage/electronicScale/addElectronicScale.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 8 - 0
src/views/equipmentManage/electronicScale/electronicScale.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>