dev
张同海 2 years ago
parent e239b01670
commit a727c34fbd

@ -10,6 +10,18 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="业务大类" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
placeholder="请选择业务大类"
v-decorator="['type', { rules: [{ required: true, message: '请输入业务大类!' }] }]"
>
<a-select-option v-for="item in TypeData" :key="item.id" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
@ -67,7 +79,7 @@ export default {
}
},
mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '349716496130117' }).then(res => {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '353559512399941' }).then(res => {
this.TypeData = res.data.rows
console.log(this.TypeData)
})

@ -10,6 +10,18 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="业务大类" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
placeholder="请选择业务大类"
v-decorator="['type', { rules: [{ required: true, message: '请输入业务大类!' }] }]"
>
<a-select-option v-for="item in TypeData" :key="item.id" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
@ -68,7 +80,7 @@ export default {
}
},
mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '349716496130117' }).then(res => {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '353559512399941' }).then(res => {
this.TypeData = res.data.rows
console.log(this.TypeData)
})
@ -83,6 +95,7 @@ export default {
this.typeData = typeOption.filters['dictData']('edi_type')
setTimeout(() => {
this.form.setFieldsValue({
type: record.type,
paraName: record.paraName,
paraCode: record.paraCode,
remark: record.remark

@ -148,7 +148,8 @@ export default {
paraCode: record.paraCode,
itemCode: record.itemCode,
itemName: record.itemName,
remark: record.remark
remark: record.remark,
tenantId: record.tenantId
})
console.log(this.form.getFieldsValue())
}, 100)

@ -16,8 +16,17 @@
</a-form-item>
</a-col> -->
<a-col :md="8" :sm="24">
<a-form-item label="编码">
<a-input v-model="queryParam.paraCode" allow-clear :placeholder="`请输入编码`" />
<a-form-item label="名称">
<a-input v-model="queryParam.ParaName" allow-clear placeholder="请输入名称" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="业务大类">
<a-select placeholder="请选择业务大类" v-model="queryParam.type" allow-clear>
<a-select-option v-for="item in TypeData" :key="item.id" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
@ -26,10 +35,10 @@
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="FnGetData"></a-button>
<a-button style="margin-left: 8px" @click="init"></a-button>
<a @click="toggleAdvanced" style="margin-left: 8px">
<!-- <a @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" />
</a>
</a> -->
</span>
</a-col>
</a-row>
@ -54,8 +63,8 @@
:title="item.title"
:align="item.align"
>
<template #default="{ row }" v-if="item.title == ''">
<span>{{ FnTurnD(row.typeCode) }}</span>
<template #default="{ row }" v-if="item.title == '业务大类'">
<span>{{ FnTurnD(row.type) }}</span>
</template>
</vxe-column>
<vxe-column title="操作" fixed="right" width="260" align="center">
@ -94,6 +103,7 @@
</template>
<script>
import { DJYTenantParamGet, DJYTenantParamDelete } from '@/api/modular/main/DJYTenantParam'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
import editItemForm from './itemEditForm.vue'
@ -120,6 +130,12 @@ export default {
},
ColumnsQuery: [],
columns: [
{
title: '业务大类',
align: 'center',
width: '80',
dataIndex: 'type'
},
{
title: '名称',
align: 'center',
@ -170,6 +186,9 @@ export default {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '353559512399941' }).then(res => {
this.TypeData = res.data.rows
})
},
handlePageChange({ currentPage, pageSize }) {
this.queryParam.pageNo = currentPage

@ -0,0 +1,154 @@
<template>
<a-modal
title="新增账号"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<!-- <a-input
placeholder="请选择类型"
v-decorator="['typeCode', { rules: [{ required: true, message: '请输入EDI类型' }] }]"
/> -->
<a-select
placeholder="请选择类型"
v-decorator="['typeCode', { rules: [{ required: true, message: '请选择类型!' }] }]"
>
<a-select-option v-for="item in TypeData" :key="item.code" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="账号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入账号"
v-decorator="['account', { rules: [{ required: true, message: '请输入账号!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入密码"
v-decorator="['password', { rules: [{ required: true, message: '请输入密码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="19">
<a-form-item label="备注" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { DjyWebsiteAccountConfigAdd } from '@/api/modular/main/WebSiteaccount'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 21 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this)
}
},
mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '349716496130117' }).then(res => {
this.TypeData = res.data.rows
console.log(this.TypeData)
})
},
methods: {
//
add(record) {
this.visible = true
this.typeData = [
{
code: 10,
name: '收货人'
},
{
code: 20,
name: '发货人'
},
{
code: 30,
name: '通知人'
},
{
code: 40,
name: '第二通知人'
}
]
},
/**
* 提交表单
*/
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
DjyWebsiteAccountConfigAdd(values)
.then(res => {
if (res.success) {
this.$message.success('新增成功')
this.confirmLoading = false
this.$emit('ok', values)
this.handleCancel()
} else {
this.$message.error(`新增失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
} else {
this.confirmLoading = false
}
})
},
handleCancel() {
this.form.resetFields()
this.visible = false
}
}
}
</script>

@ -0,0 +1,148 @@
<template>
<a-modal
title="编辑账号"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
placeholder="请选择类型"
v-decorator="['typeCode', { rules: [{ required: true, message: '请选择类型!' }] }]"
>
<a-select-option v-for="item in TypeData" :key="item.code" :value="item.code">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="账号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入账号"
v-decorator="['account', { rules: [{ required: true, message: '请输入账号!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入密码"
v-decorator="['password', { rules: [{ required: true, message: '请输入密码!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="19">
<a-form-item label="备注" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-input placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { DjyWebsiteAccountConfigEdit } from '@/api/modular/main/WebSiteaccount'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 21 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
data: {}
}
},
mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '349716496130117' }).then(res => {
this.TypeData = res.data.rows
console.log(this.TypeData)
})
},
methods: {
//
edit(record) {
this.data = record
console.log(record)
this.visible = true
const typeOption = this.$options
this.typeData = typeOption.filters['dictData']('edi_type')
setTimeout(() => {
this.form.setFieldsValue({
typeCode: record.typeCode,
account: record.account,
password: record.password,
remark: record.remark
})
console.log(this.form.getFieldsValue())
}, 100)
},
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
console.log(errors, values)
if (!errors) {
for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
console.log(this.form, values.id)
values.id = this.data.id
console.log(values)
DjyWebsiteAccountConfigEdit(values)
.then(res => {
if (res.success) {
this.$message.success('编辑成功')
this.confirmLoading = false
this.$emit('ok', values)
this.handleCancel()
} else {
this.$message.error(`编辑失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
} else {
this.confirmLoading = false
}
})
},
handleCancel() {
this.form.resetFields()
this.visible = false
}
}
}
</script>

@ -0,0 +1,226 @@
<template>
<div>
<a-card :bordered="false" :bodyStyle="tstyle">
<div
class="table-page-search-wrapper"
v-if="hasPerm('BookingTemplate:page')"
:class="advanced ? 'Open' : 'Close'"
>
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="18">
<a-row :gutter="48">
<a-col :md="8" :sm="24" v-for="item in ColumnsQuery" :key="`${item.dataIndex}1`">
<a-form-item :label="item.title">
<a-input v-model="queryParam[item.dataIndex]" allow-clear :placeholder="`请输入${item.title}`" />
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="FnGetData"></a-button>
<a-button style="margin-left: 8px" @click="init"></a-button>
<a @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" />
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
</a-card>
<a-card :bordered="false">
<vxe-toolbar>
<template #buttons>
<a-button type="primary" icon="plus" @click="$refs.addForm.add()">
新增账号
</a-button>
</template>
</vxe-toolbar>
<vxe-table :data="loadData" border :loading="loading" empty-text="">
<vxe-column type="seq" width="40" fixed="left"></vxe-column>
<vxe-column
v-for="item in columns"
:key="`${item.dataIndex}3`"
:field="item.dataIndex"
:min-width="item.width"
:title="item.title"
:align="item.align"
>
<template #default="{ row }" v-if="item.title == '类型'">
<span>{{ FnTurnD(row.typeCode) }}</span>
</template>
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
cancel-text="否"
@confirm="
e => {
confirm(e, row)
}
"
>
<vxe-button type="text">删除</vxe-button>
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
:loading="loading"
:current-page="queryParam.currentPage"
:page-size="queryParam.pageSize"
:total="queryParam.totalResult"
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange"
>
</vxe-pager>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import { DjyWebsiteAccountConfigPage, DjyWebsiteAccountConfigDelete } from '@/api/modular/main/WebSiteaccount'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
import columnSetting from '@/components/tableColumnSetting'
export default {
components: {
addForm,
editForm,
columnSetting
},
data() {
return {
TypeData: [],
// /
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
currentPage: 1,
pageSize: 10,
totalResult: 1
},
ColumnsQuery: [],
columns: [
{
title: '类型',
align: 'center',
width: '100',
dataIndex: 'typeCode'
},
{
title: '账号',
align: 'center',
width: '80',
dataIndex: 'account'
},
{
title: '密码',
align: 'center',
width: '80',
dataIndex: 'password'
},
{
title: '备注',
align: 'center',
width: '80',
dataIndex: 'remark'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise
loadData: {}
}
},
created() {},
mounted() {
this.init()
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '349716496130117' }).then(res => {
this.TypeData = res.data.rows
console.log(this.TypeData)
})
},
methods: {
FnTurnD(data) {
let Rdata = ''
this.TypeData.forEach(item => {
if (item.code == data) {
Rdata = item.value
}
})
return Rdata
},
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
},
handlePageChange({ currentPage, pageSize }) {
this.queryParam.pageNo = currentPage
this.queryParam.pageSize = pageSize
this.FnGetData()
},
FnGetData() {
this.loading = true
DjyWebsiteAccountConfigPage(this.queryParam).then(res => {
this.loadData = res.data.rows
this.loading = false
this.queryParam.currentPage = res.data.pageNo
this.queryParam.pageSize = res.data.pageSize
this.queryParam.totalResult = res.data.totalRows
})
},
/**
* 查询参数组装
*/
switchingDate() {
const obj = JSON.parse(JSON.stringify(this.queryParam))
return obj
},
confirm(e, data) {
this.DjyWebsiteAccountConfigDelete(data)
},
DjyWebsiteAccountConfigDelete(record) {
DjyWebsiteAccountConfigDelete(record).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.FnGetData()
} else {
this.$message.error(`删除失败,${res.message}`)
}
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
</style>
Loading…
Cancel
Save