Commit 7f6e0d0b by 胡悦

添加修改

1 parent b8359372
......@@ -8,8 +8,7 @@
icon="el-icon-plus"
:size="btn_size"
@click="btnClick('create')"
>添加账户类型</el-button
>
>添加账户类型</el-button>
</el-col>
<el-col style="text-align: right;" :span="22">
<el-form :inline="true" :model="accountSearchForm">
......@@ -25,8 +24,7 @@
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
></el-option>
</el-select>
</el-form-item>
<el-form-item label="账户类型名称:">
......@@ -38,12 +36,8 @@
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
:size="btn_size"
:id="accountTableParams.btnId"
>搜索</el-button
>
<el-button type="primary" :size="btn_size" :id="accountTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" @click="reset">重置</el-button>
</el-form-item>
</el-form>
</el-col>
......@@ -56,25 +50,14 @@
:pageConf="pageConf"
>
<div slot="auth-button" slot-scope="scope">
<el-button
type="text"
:size="btn_size"
@click="btnClick('detail', scope.scope)"
>查看详情</el-button
>
<el-button
type="text"
:size="btn_size"
@click="btnClick('edit', scope.scope)"
>修改</el-button
>
<el-button type="text" :size="btn_size" @click="btnClick('detail', scope.scope)">查看详情</el-button>
<el-button type="text" :size="btn_size" @click="btnClick('edit', scope.scope)">修改</el-button>
<el-button
v-if="scope.scope.delFlag == 1"
type="text"
:size="btn_size"
@click="btnClick('delete', scope.scope)"
>删除</el-button
>
>删除</el-button>
</div>
</d2-table>
</div>
......@@ -127,15 +110,6 @@ export default {
case 'create':
console.log('create')
window.location.href = `./add.html`
// this.$root.to(
// [
// '商户账号系统(开发)',
// '商户账户管理',
// '账户管理',
// '账户类型管理',
// '*新增账户类型'
// ]
// )
break
case 'edit':
window.location.href = `./add.html?id=${scope.id}`
......@@ -170,20 +144,12 @@ export default {
this.$Common.confirmDialog(tipData)
break
case 'detail':
// this.$root.close()
window.location.href = `./detail.html?id=${scope.id}`
// this.$root.to(
// [
// '商户账号系统(开发)',
// '商户账户管理',
// '账户管理',
// '账户类型管理',
// '*账户详情'
// ],
// { id: scope.id }
// )
break
}
},
reset() {
this.accountSearchForm = {}
}
}
}
......
......@@ -34,6 +34,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" :size="btn_size" :id="dictDataTableParams.btnId">搜索</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典数据</el-button>
</el-form-item>
</el-form>
......@@ -88,7 +89,8 @@ export default {
return {
DICTSTATUS: this.$Constants.DICT_STATUS,
dictDataSearchForm: {
dictType: 'functional_attributes'
dictType: '',
enableStatus: ''
},
pageConf: {
pageSize: 'pageSize',
......@@ -196,12 +198,14 @@ export default {
],
enableStatus: [{ required: true }]
},
dictData: {}
dictData: {},
params: ''
}
},
mounted() {
this.$root.eventBus.$on('params', params => {
console.log(params)
this.params = params
this.dictDataSearchForm.dictType = params.dictType
this.dictData = params
this.$refs.dictDataTable.refreshTable()
......@@ -306,6 +310,12 @@ export default {
}
}
this.$Common.confirmDialog(tipData)
},
reset() {
this.dictDataSearchForm = {
enableStatus: '',
dictType: this.params.dictType
}
}
}
}
......
......@@ -33,7 +33,9 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="btn_size" :id="dictTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" :id="dictTableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
<el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典</el-button>
</el-form-item>
</el-form>
......@@ -298,8 +300,17 @@ export default {
}
}
this.$Common.confirmDialog(tipData)
},
reset() {
this.dictSearchForm = {}
}
}
}
</script>
<style>
.el-table .cell {
line-height: 16px !important;
}
</style>
......@@ -8,7 +8,7 @@
<el-col style="text-align: right;" :span="22">
<glsx-combi-form
ref="showSearch"
labelWidth="120px"
labelWidth="110px"
:formObj="searchForm"
:searchSelectObj="searchSelectObj"
:formData="searchFormData"
......@@ -32,6 +32,7 @@
></own-cus-com>
</template>
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
</glsx-combi-form>
</el-col>
</el-row>
......@@ -129,7 +130,7 @@ export default {
label: '产品',
name: 'productId',
type: 'select',
width: '280px',
// width: '280px',
// multiple: true,
optionList: [],
optionId: 'dictValue',
......@@ -157,7 +158,7 @@ export default {
label: '功能属性类型',
name: 'functionType',
type: 'select',
width: '280px',
// width: '280px',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
......@@ -666,6 +667,14 @@ export default {
},
changeOwnSecond(obj) {
this[obj.targetItem.formName][obj.targetItem.secondVal] = obj.val
},
reset() {
this.searchForm = {
productId: '',
functionType: '',
ownedCusgroupType: '',
ownedCusGroupValues: ''
}
}
}
}
......
......@@ -2,31 +2,13 @@
<template>
<div class="prodect-list">
<el-row>
<el-col
:span="12"
style="padding-top: 16px;"
>
<el-button
icon="el-icon-plus"
:size="btn_size"
type="primary"
@click="handleAdd"
>创建产品</el-button>
<el-col :span="12" style="padding-top: 16px;">
<el-button icon="el-icon-plus" :size="btn_size" type="primary" @click="handleAdd">创建产品</el-button>
</el-col>
<el-col
style="text-align: right;"
:span="12"
>
<glsx-combi-form
ref="showSearch"
:formObj="searchForm"
:formData="searchFormData"
>
<el-button
:size="btn_size"
type="primary"
:id="tableParams.btnId"
>查询</el-button>
<el-col style="text-align: right;" :span="12">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<el-button :size="btn_size" type="primary" :id="tableParams.btnId">查询</el-button>
<el-button :size="btn_size" type="primary" @click="reset">重置</el-button>
</glsx-combi-form>
</el-col>
</el-row>
......@@ -57,8 +39,7 @@
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
</glsx-combi-form>
></glsx-combi-form>
</glsx-dialog>
</div>
</template>
......@@ -73,39 +54,53 @@ export default {
searchForm: {
productName: ''
},
searchFormData: [{
label: '产品名称',
name: 'productName',
type: 'input',
isClear: true
// keyFn: this.keyDowmGetList
}],
searchFormData: [
{
label: '产品名称',
name: 'productName',
type: 'input',
isClear: true
// keyFn: this.keyDowmGetList
}
],
getListApi: productApi.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'data.count' },
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count'
},
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.data',
tableOption: true,
tableColumns: [{
label: '产品名称',
prop: 'productName'
}, {
label: '类型',
prop: 'productType',
formatter: cellValue => {
return this.baseData.productTypeList.find(item => item.dictValue === cellValue.productType).dictLabel
tableColumns: [
{
label: '产品名称',
prop: 'productName'
},
{
label: '类型',
prop: 'productType',
formatter: cellValue => {
return this.baseData.productTypeList.find(
item => item.dictValue === cellValue.productType
).dictLabel
}
},
{
label: '产品编号',
prop: 'productCode'
},
{
label: '产品说明',
prop: 'productDetail'
},
{
label: '创建时间',
prop: 'createdTime'
}
}, {
label: '产品编号',
prop: 'productCode'
}, {
label: '产品说明',
prop: 'productDetail'
}, {
label: '创建时间',
prop: 'createdTime'
}]
]
},
// 弹窗
title: '创建产品',
......@@ -118,47 +113,60 @@ export default {
productAddress: ''
},
editRule: {
productName: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
productType: [{ required: true, message: '请选择产品类型', trigger: 'change' }],
productAddress: [{ required: true, message: '请输入产品地址', trigger: 'blur' },
productName: [
{ required: true, message: '请输入产品名称', trigger: 'blur' }
],
productType: [
{ required: true, message: '请选择产品类型', trigger: 'change' }
],
productAddress: [
{ required: true, message: '请输入产品地址', trigger: 'blur' },
{
required: true,
validator: (rule, value, callback) => {
return /[\u4E00-\u9FA5]+/.test(value) ? callback('只能输入字母、数字和符号') : callback()
return /[\u4E00-\u9FA5]+/.test(value)
? callback('只能输入字母、数字和符号')
: callback()
},
trigger: 'blur'
}]
}
]
},
editFormData: [{
label: '产品名称',
name: 'productName',
type: 'input',
maxlength: 15,
width: '300px'
}, {
label: '产品类型',
name: 'productType',
type: 'select',
width: '300px',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'productTypeList'
}, {
label: '产品说明',
name: 'productDetail',
type: 'input',
inputType: 'textarea',
maxlength: 50,
showLimit: true,
width: '300px'
}, {
label: '产品地址',
name: 'productAddress',
type: 'input',
maxlength: 50,
width: '300px'
}],
editFormData: [
{
label: '产品名称',
name: 'productName',
type: 'input',
maxlength: 15,
width: '300px'
},
{
label: '产品类型',
name: 'productType',
type: 'select',
width: '300px',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'productTypeList'
},
{
label: '产品说明',
name: 'productDetail',
type: 'input',
inputType: 'textarea',
maxlength: 50,
showLimit: true,
width: '300px'
},
{
label: '产品地址',
name: 'productAddress',
type: 'input',
maxlength: 50,
width: '300px'
}
],
// 基本数据
baseData: {
productTypeList: []
......@@ -177,8 +185,18 @@ export default {
getOptionsList(formName, hasAll = true) {
this[formName].forEach((item, index) => {
if (item.type === 'select') {
this.$set(this[formName][index], 'optionList', _.cloneDeep(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
this.$set(
this[formName][index],
'optionList',
_.cloneDeep(this.baseData[item.optionsName])
)
if (
hasAll &&
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this[formName][index].optionLabel
] !== '全部'
) {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
......@@ -194,9 +212,12 @@ export default {
})
},
handleAdd() {
this.editFormData[this.editFormData.findIndex(item => item.name === 'productType')].isDisabled = !!this.editForm.id
this.editFormData[
this.editFormData.findIndex(item => item.name === 'productType')
].isDisabled = !!this.editForm.id
this.editVisible = !this.editVisible
this.$refs.editFormRef.$refs[this.editChildRef] && this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
this.$refs.editFormRef.$refs[this.editChildRef] &&
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
},
handleProEdit(row) {
this.editForm = _.clone(row)
......@@ -216,24 +237,30 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
console.log(this.editForm)
var apiName = this.editForm.productCode ? 'updateProApi' : 'saveProApi'
productApi[apiName](this.editForm).then(res => {
if (res.code === '0') {
this.notice.okTips()
this.handleEditClose()
this.keyDowmGetList()
} else {
this.notice.errorTips(res.message)
}
}).catch(errMsg => {
this.notice.errorTips(errMsg)
})
var apiName = this.editForm.productCode
? 'updateProApi'
: 'saveProApi'
productApi[apiName](this.editForm)
.then(res => {
if (res.code === '0') {
this.notice.okTips()
this.handleEditClose()
this.keyDowmGetList()
} else {
this.notice.errorTips(res.message)
}
})
.catch(errMsg => {
this.notice.errorTips(errMsg)
})
}
})
},
reset() {
this.searchForm = {}
}
}
}
</script>
<style>
.prodect-list .el-textarea__inner {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!