From 296ed51e450747d2a5d9662b02b1e91a82492cfd Mon Sep 17 00:00:00 2001 From: FrancisHu <2756004617@qq.com> Date: Tue, 13 Aug 2024 18:53:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/material/type.js | 25 ++ src/api/system/common.js | 9 + src/components/TableModel/index.vue | 29 +- src/permission.js | 2 +- src/views/base/Mixins/common.js | 9 + src/views/base/agreement/config.js | 2 +- src/views/base/agreement/index.vue | 3 + src/views/base/customer/config.js | 4 +- src/views/base/customer/index.vue | 22 +- .../base/project/components/form-project.vue | 10 +- src/views/base/project/config.js | 2 +- src/views/base/project/index.vue | 3 + src/views/material/mixins/common.js | 72 ++++ .../material/type/components/form-type.vue | 330 ++++++++++++++++++ src/views/material/type/config.js | 16 + src/views/material/type/index.vue | 196 +++++++++++ 17 files changed, 722 insertions(+), 14 deletions(-) create mode 100644 src/api/material/type.js create mode 100644 src/api/system/common.js create mode 100644 src/views/material/mixins/common.js create mode 100644 src/views/material/type/components/form-type.vue create mode 100644 src/views/material/type/config.js create mode 100644 src/views/material/type/index.vue diff --git a/.env.development b/.env.development index 1e21487..e2949ac 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 博诺思管理系统 ENV = 'development' # 博诺思管理系统/开发环境 -VUE_APP_BASE_API = '/prod' +VUE_APP_BASE_API = '/dev-api' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/material/type.js b/src/api/material/type.js new file mode 100644 index 0000000..a47ce1e --- /dev/null +++ b/src/api/material/type.js @@ -0,0 +1,25 @@ +/** + * 物资类型管理页面 API + */ +import request from '@/utils/request' + +/** 物资类型树查询 */ +export const queryMaTypeTreeListApi = (data) => { + return request.get('/material/maType/getMaTypeList', { + params: data + }) +} + +/** 树形下物资查询 */ +export const queryMaListApi = (data) => { + return request.get('/material/maType/getListByMaType', { + params: data + }) +} + +/** 新增时查询id */ +export const queryIdWhenAddMa = (data) => { + return request.get('/material/maType/addMaType', { + params: data + }) +} diff --git a/src/api/system/common.js b/src/api/system/common.js new file mode 100644 index 0000000..b65fabe --- /dev/null +++ b/src/api/system/common.js @@ -0,0 +1,9 @@ +/** 公共接口 */ +import request from '@/utils/request' + +// 公共下拉选接口 +export const fetchSelOptApi = (data) => { + return request.get('/common/getSelectData', { + params: data + }) +} diff --git a/src/components/TableModel/index.vue b/src/components/TableModel/index.vue index 365f216..c1c80c7 100644 --- a/src/components/TableModel/index.vue +++ b/src/components/TableModel/index.vue @@ -94,12 +94,13 @@ ref="tableRef" select-on-indeterminate style="width: 100%" + v-loading="loading" > function () {}, }, - /* 列表配置项 */ + /** 列表配置项 */ columnsList: { type: Array, default: () => [], }, + /** 是否显示选择框 */ + showSel: { + type: Boolean, + default: true, + }, + }, computed: { /* 根据操作栏控制表头是否显示 */ @@ -194,6 +201,7 @@ export default { }, data() { return { + loading: false, // 列表接口查询参数 queryParams: { pageNum: 1, @@ -227,6 +235,7 @@ export default { this.formLabel.map(e => { this.$set(this.queryParams, e.f_model, '') }) + // Object.assign(this.queryParams, this.sendParams) this.getTableList() }, updated() { @@ -236,9 +245,18 @@ export default { methods: { /** 获取列表数据 */ async getTableList() { + this.loading = true + console.log(this.queryParams) const res = await this.requestApi(this.queryParams) + this.loading = false console.log(res, '列表数据') - if(res.code === 200) this.tableList = res.rows + if(res.code === 200) { + if(res.data) { + this.tableList = res.data.rows + } else { + this.tableList = res.rows + } + } }, /** 查询按钮 */ handleQuery() { @@ -277,6 +295,11 @@ export default { return width } }, + + queryTableList(params) { + Object.assign(this.queryParams, params) + this.getTableList() + } }, } diff --git a/src/permission.js b/src/permission.js index 3c72618..87cea10 100644 --- a/src/permission.js +++ b/src/permission.js @@ -14,7 +14,7 @@ router.beforeEach((to, from, next) => { // next() NProgress.start() if (getToken()) { - console.log(getToken()) + // console.log(getToken()) to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ if (to.path === '/login') { diff --git a/src/views/base/Mixins/common.js b/src/views/base/Mixins/common.js index 0ca6637..9ac11a0 100644 --- a/src/views/base/Mixins/common.js +++ b/src/views/base/Mixins/common.js @@ -61,5 +61,14 @@ export const commonMixin = { this.$refs.tableRef.getTableList() } }, + /** 手机号脱密处理 */ + phoneCrypto(phoneNumber) { + let reg = /^(1[3-9][0-9])\d{4}(\d{4}$)/ + let isMobile = reg.test(phoneNumber) + if (isMobile) { + return phoneNumber.replace(reg, "$1****$2") + } + return phoneNumber + } } } diff --git a/src/views/base/agreement/config.js b/src/views/base/agreement/config.js index 79c4a27..0a923ef 100644 --- a/src/views/base/agreement/config.js +++ b/src/views/base/agreement/config.js @@ -18,7 +18,7 @@ export const columnsList = [ { t_props: 'startTime', t_label: '开始日期', }, // { t_props: 'itemType', t_label: '租赁期限(天)', }, { t_props: 'authorizingPerson', t_label: '授权人', }, - { t_props: 'authorizingPhone', t_label: '授权人电话', }, + { t_props: 'authorizingPhone', t_label: '授权人电话', t_slot: 'authorizingPhone' }, // { t_props: 'itemType', t_label: '租赁单位类型', }, { t_props: 'url', t_label: '合同文件', t_slot: 'url' }, { t_props: 'remark', t_label: '备注', }, diff --git a/src/views/base/agreement/index.vue b/src/views/base/agreement/index.vue index c9e1808..c8d3b6d 100644 --- a/src/views/base/agreement/index.vue +++ b/src/views/base/agreement/index.vue @@ -33,6 +33,9 @@ + diff --git a/src/views/base/customer/config.js b/src/views/base/customer/config.js index 0e15e78..ae96c9b 100644 --- a/src/views/base/customer/config.js +++ b/src/views/base/customer/config.js @@ -1,13 +1,13 @@ export const formLabel = [ - { f_label: '单位名称', f_model: 'keyWords', f_type: 'ipt' }, + { f_label: '单位名称', f_model: 'name', f_type: 'ipt' }, ] export const columnsList = [ { t_props: 'name', t_label: '单位名称', }, { t_props: 'typeId', t_label: '单位类型' }, { t_props: 'companyId', t_label: '所属分公司' }, { t_props: 'materialClerk', t_label: '材料员', }, - { t_props: 'phone', t_label: '联系电话', }, + { t_props: 'phone', t_label: '联系电话', t_slot: 'phone' }, { t_props: 'isActive', t_label: '状态', t_slot: 'isActive' }, ] diff --git a/src/views/base/customer/index.vue b/src/views/base/customer/index.vue index febb299..63901d2 100644 --- a/src/views/base/customer/index.vue +++ b/src/views/base/customer/index.vue @@ -35,6 +35,9 @@ + @@ -54,15 +57,28 @@ + + diff --git a/src/views/material/type/config.js b/src/views/material/type/config.js new file mode 100644 index 0000000..0dcc691 --- /dev/null +++ b/src/views/material/type/config.js @@ -0,0 +1,16 @@ +export const formLabel = [ + { f_label: '类型名称', f_model: 'typeName', f_type: 'ipt' }, +] +export const columnsList = [ + { t_props: 'code', t_label: '类型编码', }, + { t_props: 'typeId', t_label: '仓库信息' }, + { t_props: 'constructionType', t_label: '施工类型' }, + { t_props: 'materialType', t_label: '物资类型', }, + { t_props: 'materialName', t_label: '物资名称', }, + { t_props: 'specificationCode', t_label: '规格型号' }, +] +export const dialogConfig = { + outerWidth: '40%', + outerTitle: '', + outerVisible: false, +} diff --git a/src/views/material/type/index.vue b/src/views/material/type/index.vue new file mode 100644 index 0000000..3b56c6f --- /dev/null +++ b/src/views/material/type/index.vue @@ -0,0 +1,196 @@ + + +