Browse Source

Merge branch 'develop' of http://git.wdklian.com/allen/ncs_ui into develop

wuyunfeng 11 months ago
parent
commit
b97a8750cd

+ 11 - 0
languages/en.js

@@ -1643,6 +1643,14 @@ module.exports = {
   wu20240322: {
     fileManager: 'File Manager'
   },
+  zy20240530: {
+    customerAffair: 'user event',
+    customerAffairAdd: 'Add new event',
+    customerAffairConTent: 'Event content',
+    timeMsg: 'Please select a time',
+    planTime: 'Planned execution time',
+    doTime: 'Actual execution time'
+  },
   wu20240530: {
     nurseConfig: {
       default_icon: 'Default Icon',
@@ -1660,5 +1668,8 @@ module.exports = {
   wnn20240322: {
     SOS_VOICE_BUTTON: 'SOS voice button',
     PTT: 'ptt'
+  },
+  zy20240611: {
+    boolTransfer: 'Enable managed interface'
   }
 }

+ 11 - 0
languages/es.js

@@ -1643,6 +1643,14 @@ module.exports = {
   wu20240322: {
     fileManager: 'Administrador de Archivos'
   },
+  zy20240530: {
+    customerAffair: 'Asuntos del usuario',
+    customerAffairAdd: 'Nuevos asuntos',
+    customerAffairConTent: 'Contenido de la transacción',
+    timeMsg: 'Por favor, elija la hora',
+    planTime: 'Tiempo de ejecución previsto',
+    doTime: 'Tiempo real de ejecución'
+  },
   wu20240530: {
     nurseConfig: {
       default_icon: 'Icono Predeterminado',
@@ -1660,5 +1668,8 @@ module.exports = {
   wnn20240322: {
     SOS_VOICE_BUTTON: 'Botón de voz sos',
     PTT: 'ptt'
+  },
+  zy20240611: {
+    boolTransfer: 'Habilitar interfaz gestionada'
   }
 }

+ 11 - 0
languages/ru-RU.js

@@ -1642,6 +1642,14 @@ module.exports = {
   wu20240322: {
     fileManager: 'Файловый Менеджер'
   },
+  zy20240530: {
+    customerAffair: 'Услуги пользователей',
+    customerAffairAdd: 'Дополнительные услуги',
+    customerAffairConTent: 'Содержание транзакций',
+    timeMsg: 'Выберите время',
+    planTime: 'Запланированные сроки осуществления',
+    doTime: 'Фактическое время осуществления'
+  },
   wu20240530: {
     nurseConfig: {
       default_icon: 'Иконка по умолчанию',
@@ -1659,5 +1667,8 @@ module.exports = {
   wnn20240322: {
     SOS_VOICE_BUTTON: 'Звуковая кнопка SOS',
     PTT: 'ptt'
+  },
+  zy20240611: {
+    boolTransfer: 'Включить управляемый интерфейс'
   }
 }

+ 11 - 1
languages/zh-CN.js

@@ -1638,11 +1638,18 @@ module.exports = {
     inputFileAddress: '请输入文件存储地址',
     inputMysqlAddress: '请输入mysql服务器地址',
     deleteSqlMsg: '删除操作后数据不可复原,您确定要删除此数据?'
-
   },
   wu20240322: {
     fileManager: '文件管理器'
   },
+  zy20240530: {
+    customerAffair: '用户事务',
+    customerAffairAdd: '新增事务',
+    customerAffairConTent: '事务内容',
+    timeMsg: '请选择时间',
+    planTime: '计划执行时间',
+    doTime: '实际执行时间'
+  },
   wu20240530: {
     nurseConfig: {
       default_icon: '默认图标',
@@ -1664,5 +1671,8 @@ module.exports = {
   wnn20240322: {
     SOS_VOICE_BUTTON: 'SOS语音按钮',
     PTT: '一键通'
+  },
+  zy20240611: {
+    boolTransfer: '开启托管界面'
   }
 }

+ 9 - 0
src/api/ncs_customer.js

@@ -68,10 +68,19 @@ export function saveListByCustomer(partId) {
     loading: true
   })
 }
+
 export function getListByPartId(partId) {
   return request({
     url: `/ncs/customer/getListByPartId/${partId}`,
     method: 'GET',
     loading: true
   })
+}
+
+export function getCustomerAndFrameListByPartId(partId) {
+  return request({
+    url: `/ncs/customer/get_customer_and_frame_list_by_part_id/${partId}`,
+    method: 'GET',
+    loading: true
+  })
 }

+ 56 - 0
src/api/ncs_customer_affair.js

@@ -0,0 +1,56 @@
+import request from '@/utils/request'
+
+/**
+ * 用户事务相关接口
+ * @param params
+ * @returns {*|Promise|Promise<unknown>}
+ */
+export function getList(params) {
+  return request({
+    url: '/ncs/customer_affair/page',
+    method: 'POST',
+    loading: true,
+    data: params,
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+  })
+}
+
+/** 新增用户事务 */
+export function add(params) {
+  return request({
+    url: '/ncs/customer_affair',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}
+
+/** 删除用户事务 */
+export function remove(params) {
+  const ids = params.toString()
+  return request({
+    url: `/ncs/customer_affair/${ids}`,
+    method: 'DELETE',
+    loading: true,
+    data: params
+  })
+}
+
+/** 更新用户事务 */
+export function update(id, params) {
+  return request({
+    url: `/ncs/customer_affair/${id}`,
+    method: 'put',
+    data: params
+  })
+}
+
+/** 查询用户事务 */
+export function get(id, params) {
+  return request({
+    url: `/ncs/customer_affair/${id}`,
+    method: 'get',
+    loading: false,
+    params
+  })
+}

+ 12 - 1
src/router/index.js

@@ -238,6 +238,11 @@ export const partRoutes = [
     component: Layout,
     redirect: '/customer/list',
     name: 'customer-manager',
+    meta: {
+      title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'),
+      icon: 'el-icon-s-custom',
+      noCache: true
+    },
     children: [
       {
         path: 'list',
@@ -262,6 +267,12 @@ export const partRoutes = [
         name: 'advice',
         meta: { title: i18n.t('tab.customerAdvice'), icon: 'area', noCache: true },
         hidden: true
+      },
+      {
+        path: '/customer_affair',
+        component: () => import('@/views/ncs-customer-affair/index'),
+        name: 'customer-affair',
+        meta: { title: i18n.t('zy20240530.customerAffair'), icon: 'el-icon-notebook-2', noCache: true }
       }
     ]
   },
@@ -281,7 +292,7 @@ export const partRoutes = [
       }
     ]
   },
-    // 文档管理
+  // 文档管理
   {
     path: '/file-manager',
     component: Layout,

File diff suppressed because it is too large
+ 15 - 13
src/utils/domain.js


+ 472 - 0
src/views/ncs-customer-affair/index.vue

@@ -0,0 +1,472 @@
+<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"
+        :enable-cell-change-flash="true"
+        @filterChanged="filterModifed"
+        @sortChanged="gridSortChange"
+    >
+      <!--        @rowDoubleClicked="getList"-->
+      <div slot="toolbar" class="inner-toolbar">
+        <div class="toolbar-search">
+          <en-table-search :placeholder="this.$t('action.keywords')" @search="handlerSearch" />
+        </div>
+        <div class="toolbar-btns">
+          <el-button type="primary" size="mini" @click="createCustomerAffair">{{ this.$t('zy20240530.customerAffairAdd') }}</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>
+    <el-dialog :title.sync="formtitle" :visible.sync="formshow" width="35%">
+      <div>
+        <el-form ref="editform" :rules="rules" label-width="180px" :model="formmodel">
+
+          <el-row>
+            <el-col :span="24">
+              <el-form-item :label="this.$t('customerManage.named')" prop="to_customer_id">
+                <el-select v-model="formmodel.to_customer_id" filterable :placeholder="this.$t('customerManage.choiceUser')">
+                  <el-option
+                      v-for="item in customers"
+                      :key="item.id"
+                      :label="item.frame_full_name + ' ' + item.named"
+                      :value="item.id">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-form-item :label="this.$t('zy20240530.planTime')" prop="affair_plan_time">
+              <el-date-picker
+                  v-model="formmodel.affair_plan_time"
+                  type="datetime"
+                  value-format="timestamp"
+                  :placeholder="this.$t('zy20240530.timeMsg')"
+              />
+            </el-form-item>
+          </el-row>
+
+          <el-row>
+            <el-col :span="24">
+              <el-form-item :label="this.$t('zy20240530.customerAffairConTent')" prop="content">
+                <el-input v-model="formmodel.content" type="textarea" rows="10" :placeholder="this.$t('action.inputMsg')" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="formshow = false">{{ this.$t('action.cancel') }}</el-button>
+        <el-button type="primary" @click="handlerFormSubmit('editform')">{{ this.$t('action.yes') }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+
+
+</template>
+
+<script>
+import ButtonCellRenderList from "@/components/AgGridCellRender/ButtonCellRenderList";
+import ButtonCellRender from "@/components/AgGridCellRender/ButtonCellRender";
+import ListFilter from "@/components/AgGridCustomFilter/ListFilter";
+import RadioFilter from "@/components/AgGridCustomFilter/RadioFilter";
+import {AG_GRID_LOCALE_CN} from "@/utils/AgGridVueLocaleCn";
+import * as API_CustomerAffair from "@/api/ncs_customer_affair";
+import * as API_Customer from "@/api/ncs_customer";
+import {unix2Date} from "@/utils/Foundation";
+
+export default {
+  name: "index",
+  components: { ButtonCellRenderList, ButtonCellRender, ListFilter, RadioFilter },
+  data() {
+    return {
+      tableData: [],
+      /** 列表参数 */
+      params: {
+        page_size: 20,
+        page_no: 1,
+        fixedCondition: ' part_id = ' + this.$store.getters.partId
+      },
+      /** 新建组织弹出参数 **/
+      formtitle: this.$t('zy20240530.customerAffairAdd'),
+      formshow: false,
+      formmodel: {},
+      rules: {
+        to_customer_id: [
+          { required: true, message: this.$t('customerManage.choiceUser'), trigger: 'blur' }
+        ],
+        affair_plan_time: [
+          { required: true, message: this.$t('zy20240530.timeMsg'), trigger: 'blur' }
+        ],
+        content: [
+          { required: true, message: this.$t('action.inputMsg'), trigger: 'blur' }
+        ]
+      },
+      timeRange: [new Date(2020, 11, 11, 7, 0), new Date(2020, 11, 11, 8, 0)],
+      /** ag-grid参数 **/
+      pageData: [],
+      loading: false,
+      errorId: null,
+      shopVisible: false,
+      columnDefs: null,
+      rowData: null,
+      defaultColDef: null,
+      gridOptions: null,
+      gridApi: null,
+      columnApi: null,
+      localeText: AG_GRID_LOCALE_CN,
+      filterState: null,
+      rowSelection: null,
+      frameworkComponents: null,
+      choiceAll: this.$t('action.choiceAll'),
+      customers: []
+    }
+  },
+  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: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 130 },
+      {
+        headerName: this.$t('customerManage.named'), field: 'to_customer_name', sortable: true, filter: 'agTextColumnFilter', flex: 1
+      },
+      {
+        headerName: this.$t('customerManage.frame'), field: 'to_frame_name', sortable: true, filter: 'agTextColumnFilter', flex: 1
+      },
+      {
+        headerName: this.$t('zy20240530.customerAffairConTent'), field: 'content', sortable: true, filter: 'agTextColumnFilter', flex: 1
+      },
+      // lockPosition 锁定位置,会在第一列
+      // lockPinned = true 不能拖动然后固定
+      // resizeable 单元个大小是否可以调整
+      {
+        headerName: this.$t('action.createTime'),
+        field: 'create_time',
+        sortable: true,
+        filter: 'agNumberColumnFilter',
+        width: 200,
+        valueFormatter: this.unixDateFormatter
+      },
+      {
+        headerName: this.$t('zy20240530.planTime'),
+        field: 'affair_plan_time',
+        sortable: true,
+        filter: 'agNumberColumnFilter',
+        width: 200,
+        valueFormatter: this.unixDateFormatter
+      },
+      {
+        headerName: this.$t('zy20240530.doTime'),
+        field: 'affair_do_time',
+        sortable: true,
+        filter: 'agNumberColumnFilter',
+        width: 200,
+        valueFormatter: this.unixDateFormatter
+      },
+      { headerName: this.$t('action.state'), field: 'affair_state', filter: false, cellRenderer: this.formatterStatus, minWidth: 100 },
+      { headerName: this.$t('action.handle'), field: 'id',
+        cellRendererFramework: 'ButtonCellRenderList',
+        cellRendererParams: param => {
+          return {
+            list: [
+              {
+                onClick: this.handleEdit,
+                label: this.$t('action.edit'),
+                buttonType: 'primary',
+                buttonSize: 'mini'
+              },
+              {
+                onClick: this.deleteSingle,
+                label: this.$t('action.delete'),
+                buttonType: 'danger',
+                buttonSize: 'mini',
+              }
+            ]}
+        },
+        filter: false,
+        pinned: 'right',
+        lockPinned: true,
+        minWidth: this.$i18n.locale === 'zh' ? 120 : 240,
+        resizable: false,
+        sortable: false
+      }
+    ]
+    this.defaultColDef = {
+      sortable: true,
+      resizable: true,
+      comparator: this.dateCustomComparator,
+      filterParams: {
+        debounceMs: 200,
+        newRowsAction: 'keep',
+        textCustomComparator: this.textCustomComparator,
+        comparator: this.dateCustomComparator
+      }
+    }
+    this.rowSelection = 'multiple'
+  },
+  mounted() {
+    window.onresize = this.windowResize
+    this.gridApi = this.gridOptions.api
+    this.gridColumnApi = this.gridOptions.columnApi
+    // 设置默认排序字段,应用列状态之后会触发 gridSortChange 函数,会调用getlist,后面不需要再调用this.getlist
+    this.gridColumnApi.applyColumnState({
+      state: [
+        {
+          colId: 'id',
+          sort: 'asc'
+        }
+      ]
+    })
+    this.getCustomers()
+  },
+  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_CustomerAffair.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)
+    },
+
+    /**
+     * 创建频道
+     */
+    createCustomerAffair() {
+      this.formshow = true
+      this.formmodel = {
+        channel_name: '',
+        part_id: this.$store.getters.partId
+      }
+    },
+    /** 分页大小发生改变 */
+    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_CustomerAffair.getList(param).then(response => {
+        this.loading = false
+        // this.tableData = [...response.data]
+        this.pageData = {
+          page_no: response.page_no,
+          page_size: response.page_size,
+          data_total: response.data_total
+        }
+        this.$nextTick(() => {
+          const node = this.gridApi.getDisplayedRowAtIndex(0)
+          if (node !== null && node !== undefined) {
+            node.setSelected(true)
+          }
+        })
+        this.rowData = [...response.data]
+        this.refreshPlayStatus()
+      }).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()
+    },
+    /**
+     * 格式化unix时间戳
+     **/
+    unixDateFormatter(param) {
+      if (!param.value) return ''
+      return unix2Date(param.value * 1000)
+    },
+
+    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) { // todo 通过转换后的数值过滤,需要转回原始数值
+      var model = param.api.getFilterModel()
+      this.params.filter = JSON.stringify(model)
+      this.getList()
+    },
+
+    handleEdit(row) {
+      this.formmodel = {
+        ...row
+      }
+      this.formshow = true
+    },
+    /**
+     * 提交新增表单
+     * @param formname
+     */
+    handlerFormSubmit(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          if (!this.formmodel.id) {
+            /** 新增 */
+            this.formmodel.part_id = this.$store.getters.partId
+            const customerFrame = this.customers.filter(p => p.id === this.formmodel.to_customer_id)[0]
+            this.formmodel.to_customer_name = customerFrame.named
+            this.formmodel.to_frame_id = customerFrame.frame_id
+            this.formmodel.to_frame_name = customerFrame.frame_full_name
+            this.formmodel.affair_plan_time = this.formmodel.affair_plan_time / 1000
+            console.log(this.formmodel)
+            API_CustomerAffair.add(this.formmodel).then(() => {
+              this.formshow = false
+              this.$message.success(this.$t('action.addSuccess'))
+              this.getList()
+            })
+          } else {
+            const customerFrame = this.customers.filter(p => p.id === this.formmodel.to_customer_id)[0]
+            this.formmodel.to_customer_name = customerFrame.named
+            this.formmodel.to_frame_id = customerFrame.frame_id
+            this.formmodel.to_frame_name = customerFrame.frame_full_name
+            this.formmodel.affair_plan_time = this.formmodel.affair_plan_time / 1000
+            console.log(this.formmodel)
+            API_CustomerAffair.update(this.formmodel.id, this.formmodel).then(() => {
+              this.formshow = false
+              this.$message.success(this.$t('action.editSuccess'))
+              this.getList()
+            })
+          }
+        } else {
+          this.$message.error(this.$t('action.fromError'))
+        }
+      })
+    },
+    formatterStatus(param) {
+      if (param.value) {
+        return '<span style="color:green">' + this.$t('task.success') + '</span>'
+      } else if (param.value === false) {
+        return '<span style="color:red">' + this.$t('task.failed') + '</span>'
+      } else if (param.value === null) {
+        return '<span style="color:orange">' + this.$t('task.notOperated') + '</span>'
+      }
+    },
+    getCustomers() {
+      API_Customer.getCustomerAndFrameListByPartId(this.$store.getters.partId).then(response => {
+        this.customers = response
+      }).catch(() => {
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+  fieldset{
+    border:1px solid #DCDFE6;
+    border-radius: 5px;
+  }
+
+</style>

+ 6 - 0
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -507,6 +507,12 @@
                 <el-checkbox v-model="formmodel.bool_display_nc_title" :true-label="1" :false-label="0">{{ this.$t('action.enabled') }}</el-checkbox>
               </el-form-item>
             </el-col>
+
+            <el-col :span="8">
+              <el-form-item :label="this.$t('zy20240611.boolTransfer')" prop="bool_transfer">
+                <el-checkbox v-model="formmodel.bool_transfer" :true-label="1" :false-label="0">{{ this.$t('action.enabled') }}</el-checkbox>
+              </el-form-item>
+            </el-col>
           </el-row>
 
           <el-row>