wuyunfeng 2 rokov pred
rodič
commit
fcca2b601e

+ 4 - 0
README.md

@@ -41,3 +41,7 @@ npm run lint
 # code format check and auto fix
 npm run lint -- --fix
 ```
+
+docker run -d --name pdmserver -p 8086:8086 --log-opt max-size=500m --restart always --log-opt max-file=1 -v /mnt/pdm:/opt/v70/api -v /mnt/pdm/upload:/opt/v70/api/upload -e Jar=/opt/v70/api/pdm-0.0.1-SNAPSHOT.jar -e JAR_ARG=--spring.config.location=/opt/v70/api/application.yml registry.cn-shenzhen.aliyuncs.com/wdkl/api:1.1
+
+npm

+ 2 - 2
public/domain.js

@@ -1,6 +1,6 @@
 const domain = {
-  serverUrl: 'http://192.168.1.128:8989',
-  DeviceUrl: 'http://192.168.1.128:8006',
+  serverUrl: 'http://192.168.1.198:8989',
+  DeviceUrl: 'http://192.168.1.198:8006',
   apiMode: 'dev',
   uiVersion: 1 // 1 医院版,2 月子中心版,3养老院版
 }

+ 18 - 0
src/api/pdm_asc_macdispatch.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+export function getList(params) {
+  return request({
+    url: '/pdm/ascmacdispatch/page',
+    method: 'POST',
+    loading: true,
+    data: params,
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+  })
+}
+
+export function clearRecords() {
+  return request({
+    url: '/pdm/ascmacdispatch/clear',
+    method: 'get',
+    loading: false
+  })
+}

+ 1 - 1
src/components/AgGridCustomFilter/RadioFilter.vue

@@ -44,7 +44,7 @@ export default {
        **/
     getModel() {
       const model = {
-        'filterType': 'list',
+        'filterType': 'bool',
         'type': 'equals',
         'filter': this.checkData
       }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 0
src/icons/svg/apply_record.svg


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 0
src/icons/svg/schedual.svg


+ 16 - 3
src/router/index.js

@@ -496,6 +496,19 @@ export const adminRoutes = [
     ]
   },
   {
+    path: '/ascmacdispatch/index',
+    component: Layout,
+    redirect: '/ascmacdispatch/index',
+    children: [
+      {
+        path: 'index',
+        component: () => import('@/views/asc-macdispatch/index'),
+        name: 'MACDispatch',
+        meta: { title: 'ASCII MAC地址分配记录', icon: 'apply_record', noCache: true }
+      }
+    ]
+  },
+  {
     path: '/produced-product/index',
     component: Layout,
     redirect: '/produced-product/index',
@@ -608,7 +621,7 @@ export const adminRoutes = [
         path: 'category',
         component: () => import('@/views/themometer/category'),
         name: 'category',
-        meta: { title: '体温枪产品', icon: 'el-icon-collection-tag', noCache: true }
+        meta: { title: '体温枪产品', icon: 'el-icon-s-data', noCache: true }
       }
     ]
   },
@@ -622,7 +635,7 @@ export const adminRoutes = [
         path: 'schedual',
         component: () => import('@/views/themometer/schedual'),
         name: 'schedual',
-        meta: { title: '生产班次', icon: 'el-icon-collection-tag', noCache: true }
+        meta: { title: '生产班次', icon: 'schedual', noCache: true }
       }
     ]
   },
@@ -636,7 +649,7 @@ export const adminRoutes = [
         path: 'produced',
         component: () => import('@/views/themometer/produced'),
         name: 'produced',
-        meta: { title: '体温枪生产记录', icon: 'el-icon-collection-tag', noCache: true }
+        meta: { title: '体温枪生产记录', icon: 'el-icon-tickets', noCache: true }
       }
     ]
   },

+ 1 - 1
src/settings.js

@@ -1,5 +1,5 @@
 module.exports = {
-  title: '维鼎康联呼叫中心',
+  title: '维鼎康联生产服务配置',
 
   /**
    * @type {boolean} true | false

+ 390 - 0
src/views/asc-macdispatch/index.vue

@@ -0,0 +1,390 @@
+<template>
+    <div>
+        <ag-grid-layout
+                toolbar
+                :table-height="tableHeight"
+                theme="ag-theme-alpine"
+                :column-defs="columnDefs"
+                :row-data="rowData"
+                :locale-text="localeText"
+                :grid-options="gridOptions"
+                :default-col-def="defaultColDef"
+                :animate-rows="true"
+                :row-selection="rowSelection"
+                @filterChanged="filterModifed"
+                @sortChanged="gridSortChange"
+        >
+            <div slot="toolbar" class="inner-toolbar">
+                <div class="toolbar-search">
+                    <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch"/>
+                </div>
+                                <div class="toolbar-btns">
+                                    <el-button type="danger" size="mini" @click="handleClear">清空记录</el-button>
+                                </div>
+            </div>
+            <el-pagination
+                    v-if="pageData"
+                    slot="pagination"
+                    :current-page="pageData.page_no"
+                    :page-sizes="[10, 20, 50, 100]"
+                    :page-size="pageData.page_size"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="pageData.data_total"
+                    @size-change="handlePageSizeChange"
+                    @current-change="handlePageCurrentChange"
+            />
+        </ag-grid-layout>
+
+
+
+    </div>
+</template>
+
+<script>
+  import * as API_ASC_MACDispatch from '@/api/pdm_asc_macdispatch'
+  import { unixToDate,unix2Date } from '@/utils/Foundation'
+  import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
+  import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
+  import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
+  import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
+  export default {
+    name: 'index',
+    components: { ButtonCellRender, ListFilter, RadioFilter },
+    data() {
+      return {
+        tableData: [],
+        /** 列表参数 */
+        params: {
+          page_size: 20,
+          page_no: 1,
+          sort: 'id',
+          dir: 'desc'
+        },
+        pageData: [],
+        loading: false,
+        errorId: null,
+        formShow: false,
+        userReadOnly:false,
+        columnDefs: null,
+        rowData: null,
+        defaultColDef: null,
+        gridOptions: null,
+        gridApi: null,
+        columnApi: null,
+        localeText: AG_GRID_LOCALE_CN,
+        filterState: null,
+        rowSelection: null,
+        pwdType: 'password',
+        chipRules: {
+          user_name: [
+            this.MixinRequired('登录名不能为空!')
+          ],
+          true_name: [this.MixinRequired('真实名称不能为空!')]
+        },
+        formmodel: {}
+      }
+    },
+    computed: {
+      tableHeight() {
+        return this.mainAreaHeight - 130
+      }
+    },
+    beforeMount() {
+      this.gridOptions = {}
+      this.columnDefs = [
+        {
+          headerName: '#',
+          headerCheckboxSelection: true,
+          headerCheckboxSelectionFilteredOnly: true,
+          checkboxSelection: true,
+          sortable: false, filter: false,
+          width: 100,
+          resizable: false,
+          valueGetter: this.hashValueGetter
+        },
+
+        {
+          headerName: '分配时间',
+          field: 'create_time',
+          sortable: true,
+          filter: 'agDateColumnFilter',
+          valueFormatter: this.unixDateFormatter,
+          filterParams: {
+            comparator: (filterLocalDateAtMidnight, cellValue) => { // 所有数据都由服务器端过滤,此处只需返回0 即可
+              const celldate = unixToDate(cellValue, 'yyyy-MM-dd 00:00:00')
+              return (new Date(celldate).getTime() / 1000) - (filterLocalDateAtMidnight.getTime() / 1000)
+            }
+          }
+        },
+        {
+          headerName: '起始数字', field: 'start_num', sortable: true, filterFramework: 'agNumberColumnFilter', flex: 1
+        },
+        {
+          headerName: '结束数字', field: 'end_num', sortable: true, filterFramework: 'agNumberColumnFilter', flex: 1
+        },
+        {
+          headerName: '分配数量', field: 'dispatch_qty', sortable: true, filterFramework: 'agNumberColumnFilter', flex: 1
+        }
+      ]
+      this.defaultColDef = {
+        // filter: 'agTextColumnFilter',
+        sortable: true,
+        resizable: true,
+        // comparator: this.testComparator,
+        filterParams: {
+          debounceMs: 200,
+          newRowsAction: 'keep'
+          //  textCustomComparator: this.textCustomComparator,
+          // comparator: this.testComparator
+        }
+      }
+      this.rowSelection = 'multiple'
+    },
+    mounted() {
+      window.onresize = this.windowResize
+      this.gridApi = this.gridOptions.api
+      this.gridColumnApi = this.gridOptions.columnApi
+      this.gridColumnApi.applyColumnState({
+        state: [
+          {
+            colId: 'create_time',
+            sort: 'desc'
+          }
+        ]
+      })
+    },
+    methods: {
+      windowResize() {
+        this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 84)
+      },
+      handlerDelete(ids) {
+        this.$confirm(this.$t('action.sureDelete'), this.$t('action.waring'), {
+          confirmButtonText: this.$t('action.yes'),
+          cancelButtonText: this.$t('action.cancel'),
+          type: 'warning'
+        }).then(() => {
+          API_ASC_MACDispatch.remove(ids).then(
+            response => {
+              this.getList()
+              this.$message({
+                type: 'success',
+                message: this.$t('action.deleted')
+              })
+            }
+          ).catch(response => {
+            this.$message({
+              type: 'info',
+              message: response.message
+            })
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: this.$t('action.cancelDelete')
+          })
+        })
+      },
+      /** 删除 **/
+      deleteSingle(row) {
+        this.handlerDelete(row.id)
+      },
+
+      /** 修改  **/
+      handleEdit(params) {
+
+        this.formmodel = {
+          ...params
+        }
+        delete this.formmodel.password
+        this.formShow = true
+        this.userReadOnly=true
+        this.formTitle = '编辑用户'
+      },
+      /** 分页大小发生改变 */
+      handlePageSizeChange(size) {
+        this.params.page_size = size
+        this.getList()
+      },
+
+      /** 分页页数发生改变 */
+      handlePageCurrentChange(page) {
+        this.params.page_no = page
+        this.getList()
+      },
+      /** 加载列表数据 */
+      getList() {
+        this.loading = true
+        const param = this.MixinClone(this.params)
+        this.gridApi.showLoadingOverlay()
+        API_ASC_MACDispatch.getList(param).then(response => {
+          this.loading = false
+          this.pageData = {
+            page_no: response.page_no,
+            page_size: response.page_size,
+            data_total: response.data_total
+          }
+          this.rowData = [...response.data]
+        }).catch(() => {
+          this.loading = false
+        })
+      },
+      /** 处理搜索 */
+      handlerSearch(keywords) {
+        this.params.query = keywords
+        this.getList()
+      },
+      /** 处理字段排序 */
+      tableSort(column) {
+        if (column.order !== null) {
+          this.params.sort = column.prop
+          this.params.dir = column.order === 'ascending' ? 'asc' : 'desc'
+        } else {
+          this.params.sort = null
+          this.params.dir = null
+        }
+        this.getList()
+      },
+      forDate(row, column, cellValue) {
+        return unixToDate(row.create_time)
+      },
+      testComparator(valueA, valueB, nodeA, nodeB, isInverted) {
+        if (valueB === null) {
+          return 0
+        }
+        const cellDate = new Date(valueB)
+        const day = cellDate.getDate()
+        const month = cellDate.getMonth()
+        const year = cellDate.getFullYear()
+        const cellDateMidNight = new Date(year, month, day)
+        if (new Date(valueA) < cellDateMidNight) {
+          return 1
+        } else if (new Date(valueA) > cellDateMidNight) {
+          return -1
+        } else {
+          return 0
+        }
+      },
+      gridSortChange(param) {
+        const columnState = param.columnApi.getColumnState()
+        // 排序状态
+        const sortState = columnState.filter(function(s) {
+          return s.sort != null
+        }).map(function(s) {
+          return {
+            colId: s.colId,
+            sort: s.sort,
+            sortIndex: s.sortIndex
+          }
+        }).sort(function(a, b) {
+          return a.sortIndex - b.sortIndex
+        })
+        if (sortState.length > 0) {
+          if (sortState.length === 1) {
+            this.params.sort = sortState[0].colId
+            this.params.dir = sortState[0].sort
+          } else {
+            let sortstring = ''
+            sortState.forEach(function(item) {
+              sortstring += item.colId + ' ' + item.sort + ','
+            })
+            this.params.sort = sortstring.substring(0, sortstring.length - 1)
+            this.params.dir = ' '
+          }
+        } else {
+          delete this.params.sort
+          delete this.params.dir
+        }
+
+        this.getList()
+      },
+      filterModifed(param) {
+        var model = param.api.getFilterModel()
+        this.params.filter = JSON.stringify(model)
+        this.getList()
+      },
+      numberParser(text) {
+        return true
+      },
+      textCustomComparator(filter, value, text) {
+        return true
+      },
+      hashValueGetter(params) {
+        // return params.node.rowIndex + 1
+        return ''
+      },
+      dateValueFormatter(params) {
+        return unixToDate(params.value)
+      },
+      /** 获取设备类型文字显示,从deviceTypeTransfer 中找出value值对应的key显示出来 */
+      deviceTypeGetter(params) {
+        const gridVal = params.data.burn_tool
+        if (gridVal) {
+          return this.toolOptions.filter(p => p.value === gridVal).map(p => p.key)
+        }
+        return ''
+      },
+      handlerFormSubmit(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            /** 新增 */
+            if (!this.formmodel.id) {
+              API_ASC_MACDispatch.add(this.formmodel).then(r => {
+                this.$message.success('添加成功!')
+                this.formShow = false
+                this.getList()
+              })
+            } else {
+              /** 修改 */
+              API_ASC_MACDispatch.update(this.formmodel.id, this.formmodel).then(() => {
+                this.$message.success('修改成功!')
+                this.formShow = false
+                this.getList()
+              })
+            }
+          } else {
+            this.$message.error('输入错误,请检查!')
+            return false
+          }
+        })
+      },
+
+      /** 添加事件 **/
+      handleClear() {
+        this.$confirm(this.$t('action.sureDelete'), this.$t('action.waring'), {
+          confirmButtonText: this.$t('action.yes'),
+          cancelButtonText: this.$t('action.cancel'),
+          type: 'warning'
+        }).then(() => {
+          API_ASC_MACDispatch.clearRecords().then(
+            response => {
+              this.getList()
+              this.$message({
+                type: 'success',
+                message: this.$t('action.deleted')
+              })
+            }
+          ).catch(response => {
+            this.$message({
+              type: 'info',
+              message: response.message
+            })
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: this.$t('action.cancelDelete')
+          })
+        })
+      },
+      /** 格式化时间函数 */
+      unixDateFormatter(param) {
+        if (!param.value) return ''
+        return unix2Date(param.value * 1000)
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 3 - 1
src/views/produce-file/index.vue

@@ -202,12 +202,14 @@
         fileUseFor:[
           { key: 'MCU', value: 1 },
           { key: 'ROM', value: 2 },
-          { key: 'APP', value: 3 }
+          { key: 'APP', value: 3 },
+          { key: 'LOGO', value: 4 }
         ],
         fileType:[
           { key: '文本文件', value: 1 },
           { key: '二进制文件', value: 2 },
           { key: 'APK文件', value: 3 },
+          { key: '图片', value: 5 },
           { key: '其他文件', value: 4 }
         ],
         booleanRender: [

+ 40 - 2
src/views/product/index.vue

@@ -99,7 +99,11 @@
                             <el-checkbox v-model="formmodel.bool_third_party">是否为外购设备</el-checkbox>
                         </el-form-item>
                     </el-col>
-
+                    <el-col :span="8">
+                        <el-form-item label="" prop="bool_change_logo">
+                            <el-checkbox v-model="formmodel.bool_change_logo" @change="logoChange">是否更换开机LOGO</el-checkbox>
+                        </el-form-item>
+                    </el-col>
                 </el-row>
 
                 <el-row v-if="formmodel.bool_mcu">
@@ -125,6 +129,11 @@
                             <el-checkbox v-model="formmodel.need_mcu_mac" >是否需要写入MAC地址</el-checkbox>
                         </el-form-item>
                     </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="" prop="bool_ascii_mac">
+                            <el-checkbox v-model="formmodel.bool_ascii_mac" >是否ASCII MAC地址</el-checkbox>
+                        </el-form-item>
+                    </el-col>
                 </el-row>
                 <el-row v-if="formmodel.bool_rom">
                     <el-col :span="12">
@@ -159,6 +168,18 @@
                         </el-form-item>
                     </el-col>
                 </el-row>
+                <el-row >
+
+                    <el-col :span="12" v-if="formmodel.bool_change_logo">
+                        <el-form-item label="Logo图片" prop="logo_file_union_id">
+                            <el-select v-model="formmodel.logo_file_union_id" placeholder="请选择Logo文件" clearable>
+                                <el-option v-for="(item, index) in allFiles.filter(p=>p.file_use===4)" :key="index" :label="item.file_name"
+                                           :value="item.union_id"/>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+
                 <el-row v-if="formmodel.bool_app_install">
                     <el-col :span="24">
                         <el-form-item label="安装APK" prop="qcode_qty">
@@ -235,7 +256,8 @@
           mcu_chip_union_id:[{ required: false, message: 'MCU芯片必须选择', trigger: 'blur' }],
           mcu_file_union_id:[{ required: false, message: 'MCU文件必须选择', trigger: 'blur' }],
           rom_chip_union_id:[{ required: false, message: 'ROM芯片必须选择', trigger: 'blur' }],
-          rom_file_union_id:[{ required: false, message: 'ROM文件必须选择', trigger: 'blur' }]
+          rom_file_union_id:[{ required: false, message: 'ROM文件必须选择', trigger: 'blur' }],
+          logo_file_union_id:[{ required: false, message: 'Logo文件必须选择', trigger: 'blur' }]
         },
         formmodel: {},
         /** 设备类型转换数组 **/
@@ -340,6 +362,14 @@
           }
         },
         {
+          headerName: '是否更换开机LOGO', field: 'bool_change_logo', sortable: true, filterFramework: 'RadioFilter', filterParams: {
+            listData: this.booleanRender
+          }, width: 180,
+          cellRenderer: (para) => {
+            return this.radioFilterFormatter(para, this.booleanRender)
+          }
+        },
+        {
           headerName: '是否需要打印二维码',
           field: 'need_print_qcode',
           sortable: true,
@@ -357,6 +387,7 @@
         { headerName: 'ROM芯片名称', field: 'rom_chip_name', sortable: true, filter: 'agTextColumnFilter', width: 180 },
         { headerName: 'MCU文件名称', field: 'mcu_file_name', sortable: true, filter: 'agTextColumnFilter', width: 180 },
         { headerName: 'ROM文件名称', field: 'rom_file_name', sortable: true, filter: 'agTextColumnFilter', width: 180 },
+        { headerName: '开机LOGO文件', field: 'logo_file_name', sortable: true, filter: 'agTextColumnFilter', width: 180 },
         {
           headerName: '打印方案名称', field: 'print_solution_union_id', sortable: true, filterFramework: 'ListFilter', width: 150,
           filterParams: {
@@ -696,6 +727,13 @@
           this.chipRules.rom_chip_union_id[0].required=false
           this.chipRules.rom_file_union_id[0].required=false
         }
+      },
+      logoChange(val){
+        if(val){
+          this.chipRules.logo_file_union_id[0].required=true
+        }else{
+          this.chipRules.logo_file_union_id[0].required=false
+        }
       }
     }
   }