Commit e589f7fa authored by qinj's avatar qinj

Merge branch 'dev' of http://120.25.63.219:6088/rex/portalhtml into dev

parents 18d6994e 68298d8b
......@@ -173,5 +173,16 @@ export default {
layout: 12
}
}
},
// 公司企称
qcc: {
searchUrl: '/qcc/search',
formDesc: {
Name: {
label: '公司名称',
type: 'input',
layout: 12
}
}
}
}
......@@ -248,7 +248,7 @@ export default {
const params = this.$translateToC4CData(data)
delete params.total
this.$request(url, params).then(res => {
this.tableData = res.results || []
this.tableData = res.results.Result || []
this.pageData.total = Number(res.totalSize || 0)
this.loading = false
})
......
import LovComponent from './index.vue'
const Lovs = {
install: function(Vue) {
Vue.component(LovComponent.name, LovComponent)
}
}
export default Lovs
<template>
<div
class="lovs"
style="width: 100%"
>
<el-input
v-model="text"
:readonly="true"
:disabled="disabled"
:placeholder="placeholder ? placeholder : '请选择'"
style="width: 100%"
@mouseenter.native="hovering = true"
@mouseleave.native="hovering = false"
@focus="focused = true"
@blur="focused = false"
>
<i
v-if="clearable && showClear"
slot="suffix"
class="el-input__icon el-icon-circle-close el-input__clear"
@click="clear"
/>
<i
v-if="!disabled"
slot="suffix"
class="el-input__icon el-icon-search"
@click="createLovTable"
/>
</el-input>
<el-dialog
v-el-drag-dialog
:visible.sync="dialogTableVisible"
:title="'请选择'+label"
width="50%"
class="lov-dialog"
:append-to-body="true"
:before-close="handleClose"
@opened="onPreviewDialogOpened"
@dragDialog="handleDrag"
>
<el-row class="rowbig">
<el-col
:span="16"
class="dynamic-class"
>
<ele-form
v-model="searchData"
v-bind="formConfig"
/>
</el-col>
<el-col :span="8">
<div style="display:flex;justify-content: flex-end;">
<el-button
type="primary"
@click="handleSearch"
>查询</el-button>
<el-button
plain
@click="handleReset"
>重置</el-button>
<el-button
v-if="multi"
plain
@click="handleMultiSelect"
>选择</el-button>
</div>
</el-col>
</el-row>
<div>
<el-table
v-loading="loading"
:data="tableData"
fit
highlight-current-row
:header-cell-style="dialogHeaderCellStyle"
style="width: 100%;"
@row-dblclick="handleSelect"
@selection-change="(rows) => (selectedRows = rows)"
>
<el-table-column
v-if="multi"
type="selection"
width="55"
align="center"
/>
<el-table-column
v-for="(item, key) in formConfig.formDesc"
:key="key"
:label="item.label"
:width="item.width"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">{{ item.value ? scope.row[item.value] : scope.row[key] }}</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="pageData.total > 0"
style="padding-bottom:8px"
:total="pageData.total"
:page.sync="pageData.currentPage"
:limit.sync="pageData.pageSize"
@pagination="fetchTable"
/>
</el-dialog>
</div>
</template>
<script>
/* eslint-disable no-eval */
import Pagination from '@/components/Pagination'
import elDragDialog from '@/directive/el-drag-dialog'
import lovData from '@/api/lov-data'
const isNumber = require('is-number')
function isNil(value) {
return value == null
}
export default {
name: 'Lovs',
directives: { elDragDialog },
components: {
Pagination
},
filters: {
dialogWidthFilter(width) {
if (isNil(width) || !isNumber(width)) {
return '60%'
} else {
return `${width}%`
}
}
},
props: {
code: {
type: String,
default: ''
},
searchUrl: {
type: String,
default: ''
}, // 请求地址,请求地址为空时候使用`/${code}/search`查询
label: {
type: String,
default: ''
}, // 作为标题
initialParams: {
type: Object,
default: () => { }
}, // 初始搜索条件
displayKey: {
type: String,
default: ''
}, // 展示在页面的属性值,若无则使用表格第一列数据
/* eslint-disable */
returnFn: [Function], // 处理返回值函数,使其符合接口要求
/* eslint-enable */
value: {
type: String,
default: ''
},
multi: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
/* eslint-disable */
beforeSelected: [Function],
/* eslint-enable */
clearable: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: ''
}
},
data: function() {
return {
defaultFormConfig: {
isShowSubmitBtn: false,
isShowBackBtn: false,
labelPosition: 'left'
},
formConfig: {
formDesc: {}
},
dialogTableVisible: false,
searchData: {},
tableData: [],
pageData: {
total: 0,
currentPage: 0,
pageSize: 10
},
text: this.value,
selectedRows: [],
hovering: false,
focused: false,
loading: true
}
},
computed: {
showClear() {
return this.focused || this.hovering
}
},
watch: {
value(val) {
this.text = val
}
},
methods: {
clear() {
this.text = '' // 清空显示文本
const val = this.translateRow({})
this.$emit('handleSelected', val)
},
// v-el-drag-dialog onDrag callback function
handleDrag() {
// this.$refs.select.blur()
},
createLovTable() {
var formConfig = Object.assign(this.defaultFormConfig, lovData[this.code])
this.formConfig = formConfig
this.dialogTableVisible = true
this.handleSearch()
},
handleSearch() {
this.pageData.currentPage = 1
this.fetchTable()
},
handleReset() {
this.searchData = {}
this.handleSearch()
},
fetchTable() {
this.loading = true
const url = this.searchUrl ? this.searchUrl : `/${this.code}/search`
const data = Object.assign({}, this.initialParams, this.searchData, this.pageData)
const params = this.$translateToC4CData(data)
delete params.total
this.$request(url, params).then(res => {
this.tableData = res.results.Result || []
this.pageData.total = Number(res.totalSize || 0)
this.loading = false
})
},
handleSelect(row) {
if (typeof this.beforeSelected === 'function') {
this.beforeSelected(this.setValue, row)
} else {
this.setValue(row)
}
},
setValue(row) {
// 展示的key值,如果没有传值进来则使用表格第一列的值
const key = this.displayKey ? this.displayKey : Object.keys(this.formConfig.formDesc)[0]
this.text = row[key]
const val = this.translateRow(row)
this.$emit('handleSelected', val)
this.dialogTableVisible = false
},
translateRow(row) {
var result
if (this.returnFn && typeof this.returnFn === 'function') {
result = this.returnFn(row)
if (Object.prototype.toString.call(result) !== '[object Object]') {
throw Error('lov配置中returnFn的返回值不是object')
}
} else {
result = this.text
}
return result
},
handleMultiSelect() {
if (this._.isEmpty(this.selectedRows)) {
this.$notify({
title: '警告',
message: '未选择',
type: 'warning',
duration: 2000
})
} else {
const values = this.selectedRows.map((r) => r[this.lovData.valueField])
const texts = this.selectedRows.map((r) => r[this.lovData.textField])
this.$emit('handleSelected', this.selectedRows)
this.text = this._.toString(texts)
// this.$emit('update:text', this._.toString(texts))
this.$parent.$emit('el.form.change', [values])
this.dialogTableVisible = false
}
},
onPreviewDialogOpened() { },
handleClose(done) {
done()
},
dialogHeaderCellStyle() {
return 'background-color: #f7f8fa;'
}
}
}
</script>
<style lang="scss">
.lov-dialog {
.el-dialog__header {
padding: 16px 20px;
border-bottom: 1px solid #f4f4f4;
}
.el-dialog__body {
padding: 16px 20px;
}
}
</style>
......@@ -15,6 +15,7 @@ import EleSearch from '@/components/EleSearch'
import TableBtns from '@/components/TableBtns'
import FormTitle from '@/components/FormTitle'
import Lov from '@/components/Lov'
import Lovs from '@/components/Lovs'
import BusinessTable from '@/components/BusinessTable'
import DetailTable from '@/components/DetailTable'
import DescriptionTable from '@/components/DescriptionTable'
......@@ -60,6 +61,7 @@ Vue.use(EleSearch)
Vue.use(TableBtns)
Vue.use(FormTitle)
Vue.use(Lov)
Vue.use(Lovs)
Vue.use(BusinessTable)
Vue.use(DetailTable)
Vue.use(DescriptionTable)
......
......@@ -77,9 +77,17 @@ router.beforeEach(async(to, from, next) => {
} else {
console.info('=========================3333')
// other pages that do not have permission to access are redirected to the login page.
if (to.path === '/city-register') {
next({ path: '/city-register'})
} else if (to.path === '/prov-register') {
next({ path : '/prov-register'})
} else {
next(`/login?redirect=${to.path}`)
NProgress.done()
}
// next(`/login?redirect=${to.path}`)
// NProgress.done()
}
}
})
......
<template>
<div>
<!-- <Title :title="title">
<span>*</span>为必填项
</Title> -->
<div class="form-container">
<form-title :title="formTitle" />
<ele-form
ref="form"
v-model="formData"
v-bind="basicConfig"
>
<template v-slot:form-btn>
<el-button
type="primary"
icon="el-icon-right"
:loading="loading"
@click="handleSubmit"
>保存提交</el-button>
</template>
</ele-form>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import formConfig from './constant'
export default {
components: {
Title
},
props: {
// 状态判断是由那个页面跳转
status: {
type: String,
default: ''
},
formList: {
type: Object,
default: Function
}
},
data() {
return {
// title: '报价申请',
formTitle: '基础信息',
loading: false,
formData: {},
basicConfig: formConfig.basicConfig,
adressConfig: formConfig.adressConfig
}
},
// watch: {
// formList() {
// this.formData = this.formList
// },
// status: {
// handler(newVal) {
// console.log(newVal)
// },
// immediate: true,
// deep: true
// }
// },
// mounted() {
// // 判断是有那个页面跳转,一个是从报价新增按钮一个是从商机
// if (this.status === '新增') {
// this.formData = {
// Ext_QuoteType_KUT: '预备货报价',
// Ext_QuoteStatus_KUT: '101'
// }
// this.formConfig.formDesc.ProductRecipientPartyName.disabled = false
// } else {
// this.formData = {
// Ext_QuoteType_KUT: '普通报价',
// Ext_QuoteStatus_KUT: '101'
// }
// }
// },
methods: {
// handleSubmit() {
// // console.log('跳转')
// this.stepBmit()
// },
// stepBmit() {
// // 将表单中的存储的数据返回
// this.$emit('changeComponent', 'productInforma', this.formData)
// }
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<!-- <Title :title="title">
<span>*</span>为必填项
</Title> -->
<div class="form-container">
<form-title :title="formTitle" />
<ele-form
ref="form"
v-model="formData"
v-bind="basicConfig"
>
<template v-slot:form-btn>
<el-button
type="primary"
icon="el-icon-right"
:loading="loading"
@click="handleSubmit"
>保存提交</el-button>
</template>
</ele-form>
</div>
</div>
</template>
<script>
import Title from '@/components/Title'
import formConfig from './constant'
export default {
components: {
Title
},
props: {
// 状态判断是由那个页面跳转
status: {
type: String,
default: ''
},
formList: {
type: Object,
default: Function
}
},
data() {
return {
// title: '报价申请',
formTitle: '基础信息',
loading: false,
formData: {},
basicConfig: formConfig.basicConfig,
adressConfig: formConfig.adressConfig
}
},
// watch: {
// formList() {
// this.formData = this.formList
// },
// status: {
// handler(newVal) {
// console.log(newVal)
// },
// immediate: true,
// deep: true
// }
// },
// mounted() {
// // 判断是有那个页面跳转,一个是从报价新增按钮一个是从商机
// if (this.status === '新增') {
// this.formData = {
// Ext_QuoteType_KUT: '预备货报价',
// Ext_QuoteStatus_KUT: '101'
// }
// this.formConfig.formDesc.ProductRecipientPartyName.disabled = false
// } else {
// this.formData = {
// Ext_QuoteType_KUT: '普通报价',
// Ext_QuoteStatus_KUT: '101'
// }
// }
// },
methods: {
// handleSubmit() {
// // console.log('跳转')
// this.stepBmit()
// },
// stepBmit() {
// // 将表单中的存储的数据返回
// this.$emit('changeComponent', 'productInforma', this.formData)
// }
}
}
</script>
<style>
</style>
\ No newline at end of file
// import dictionary from '@/api/dictionary'
const basicConfig = {
labelPosition: 'left',
isShowBackBtn: false,
isShowSubmitBtn: true,
formDesc: {
Name: {
type: 'lov',
label: '公司企称',
layout: 24
},
ExtSecondName_SDK: {
type: 'input',
label: '公司企称曾用名',
layout: 12,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
},
}
}
const adressConfig = {
labelPosition: 'left',
isShowBackBtn: false,
......@@ -28,4 +72,4 @@ const adressConfig = {
}
}
export default { adressConfig }
export default { basicConfig, adressConfig }
<template>
<!-- <div>
<basicConfig />
<adressConfig />
</div> -->
<div>
<Title :title="title">
<span>*</span>为必填项
</Title>
<div class="form-container">
<ele-form-section
v-model="formData"
:request-fn="handleSubmit"
:rules="rules"
:sections="sections"
@request-success="handleSuccess"
/>
</div>
</div>
</template>
<script>
import basicConfig from './components/basic-config/index'
import Title from '@/components/Title'
export default {
components: {
Title
},
data () {
return {
title: '代理商新增',
formData: {},
sections: [
{
title: '基本信息',
formDesc: {
Name: {
type: 'lov',
label: '公司企称',
layout: 24,
code: 'qcc',
returnFn: function(row) {
return {
Name: row.Name
}
},
},
ExtSecondName_SDK: {
type: 'input',
label: '公司企称曾用名',
layout: 12,
},
ExtSocialUnifiedCreditCode_SDK: {
type: 'input',
label: '社会统一信用代码',
layout: 12
},
ExtRegisteredCapital_SDK: {
type: 'input',
label: '注册资本(万元)',
layout: 12,
},
ExtCorporateName_SDK: {
type: 'input',
label: '法人',
layout: 12,
},
// Ext_QuoteOppotunity_KUT: {
// type: 'input',
// label: '税务登记编号',
// layout: 12
// },
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
},
}
},
{
title: '地址信息',
formDesc: {
// Name: {
// type: 'select',
// label: '省份',
// layout: 12
// },
// ExtSecondName_SDK: {
// type: 'select',
// label: '城市',
// layout: 12,
// },
// ExtSocialUnifiedCreditCode_SDK: {
// type: 'select',
// label: '县市',
// layout: 12
// },
ExtAddressDetail_SDK: {
type: 'input',
label: '详细经营地址',
layout: 12,
},
}
},
{
title: '联系信息',
formDesc: {
ExtLeader_SDK: {
type: 'input',
label: '公司负责人姓名',
layout: 12
},
ExtLeaderPhone_SDK: {
type: 'input',
label: '公司负责人联系方式',
layout: 12
},
ExtLeaderEmail_SDK: {
type: 'input',
label: '公司负责人邮箱',
layout: 12
},
ExtUnis_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人姓名'
},
ExtUnisPhone_SDK: {
type: 'input',
layout: 12,
label: 'Unis业务负责人联系方式'
},
ExtUnisEmail_SDK: {
type: 'input',
label: 'Unis业务负责人邮箱',
layout: 12
},
ExtBusiness_SDK: {
type: 'input',
layout: 12,
label: '商务负责人姓名'
},
ExtBusinessPhone_SDK: {
type: 'input',
layout: 12,
label: '商务负责人联系方式'
},
ExtBusinessEmail_SDK: {
type: 'input',
label: '商务负责人邮箱',
layout: 12
},
}
}
],
// 同 vue-ele-form
// rules: {
// Name: { required: true, message: '名称必填' }
// }
}
},
methods: {
handleSubmit (data) {
console.log(data)
// return Promise.resolve()
},
handleSuccess () {
this.$message.success('创建成功')
}
}
}
</script>
<style>
<style lang="scss" scoped>
::v-deep .el-row--flex {
display: -webkit-box;
.el-col-14 {
width: 90%;
}
}
::v-deep .ele-form-btns{
.el-form-item__content {
margin-left: 45% !important;
}
}
</style>
......@@ -9,7 +9,6 @@
</div>
<div class="two-column">
<div class="left" />
<ComplaintsAndSuggestions />
</div>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
......@@ -83,7 +82,7 @@
<script>
import SystemNotice from './components/SystemNotice'
import ComplaintsAndSuggestions from './components/ComplaintsAndSuggestions'
// import ComplaintsAndSuggestions from './components/ComplaintsAndSuggestions'
import PanelGroup from './components/PanelGroup'
import LineChart from './components/LineChart'
import RaddarChart from './components/RaddarChart'
......@@ -116,7 +115,7 @@ export default {
name: 'DashboardAdmin',
components: {
SystemNotice,
ComplaintsAndSuggestions,
// ComplaintsAndSuggestions,
PanelGroup,
LineChart,
RaddarChart,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment