Commit 7f6e0d0b by 胡悦

添加修改

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