lilu 2 years ago
commit 4dccba6f7c

@ -111,17 +111,15 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="属性字符串" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="客户属性" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select <a-select
mode="multiple" mode="multiple"
placeholder="请选择属性字符串" placeholder="请选择客户属性"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择属性字符串' }] }]" v-decorator="['WpropString', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
> >
<a-select-option value="委托单位">委托单位</a-select-option> <a-select-option v-for="item in propStringData" :key="item.id" :value="item.code">{{
<a-select-option value="车队">车队</a-select-option> item.value
<a-select-option value="报关行">报关行</a-select-option> }}</a-select-option>
<a-select-option value="订舱管理">订舱管理</a-select-option>
<a-select-option value="代理">代理</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -305,13 +303,17 @@ export default {
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
ContactsData: [], ContactsData: [],
TypeData: [] TypeData: [],
propStringData: []
} }
}, },
mounted() { mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => { sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => {
this.TypeData = res.data.rows this.TypeData = res.data.rows
}) })
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346100897906757' }).then(res => {
this.propStringData = res.data.rows
})
}, },
methods: { methods: {
removeCheckboxRow() { removeCheckboxRow() {

@ -111,17 +111,15 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-item label="属性字符串" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="客户属性" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select <a-select
mode="multiple" mode="multiple"
placeholder="请选择属性字符串" placeholder="请选择客户属性"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择属性字符串' }] }]" v-decorator="['WpropString', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
> >
<a-select-option value="委托单位">委托单位</a-select-option> <a-select-option v-for="item in propStringData" :key="item.id" :value="item.code">{{
<a-select-option value="车队">车队</a-select-option> item.value
<a-select-option value="报关行">报关行</a-select-option> }}</a-select-option>
<a-select-option value="订舱管理">订舱管理</a-select-option>
<a-select-option value="代理">代理</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -306,19 +304,38 @@ export default {
form: this.$form.createForm(this), form: this.$form.createForm(this),
ContactsData: [], ContactsData: [],
Data: {}, Data: {},
TypeData: [] TypeData: [],
propStringData: []
} }
}, },
mounted() { mounted() {
DjyCustomerDetail({ id: this.RowData.id }).then(res => { DjyCustomerDetail({ id: this.RowData.id }).then(res => {
this.Data = res.data this.Data = res.data
console.log(res.data)
let WpropString = []
if (res.data.propString) {
res.data.propString.split(']').forEach(item => {
if (item.split('[')[1]) {
WpropString.push(item.split('[')[1])
}
})
}
res.data.contacts.forEach((item, index) => {
item.WebKey = index + 1
})
this.ContactsData = res.data.contacts
this.form.setFieldsValue({ this.form.setFieldsValue({
...res.data ...res.data,
WpropString
}) })
}) })
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => { sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => {
this.TypeData = res.data.rows this.TypeData = res.data.rows
}) })
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346100897906757' }).then(res => {
this.propStringData = res.data.rows
})
}, },
methods: { methods: {
removeCheckboxRow() { removeCheckboxRow() {
@ -387,7 +404,14 @@ export default {
values[key] = JSON.stringify(values[key]) values[key] = JSON.stringify(values[key])
} }
} }
DjyCustomerEdit({ ...this.Data, ...values, contacts: this.ContactsData }) let propString = ''
values.WpropString.split('["')[1]
.split('"]')[0]
.split('","')
.forEach(item2 => {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
})
DjyCustomerEdit({ ...this.Data, ...values, propString: propString, contacts: this.ContactsData })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('编辑成功') this.$message.success('编辑成功')

@ -88,7 +88,8 @@
:title="item.title" :title="item.title"
:align="item.align" :align="item.align"
v-if="item.checked" v-if="item.checked"
></vxe-column> >
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center"> <vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }"> <template #default="{ row }">
<vxe-button type="text" @click="TabsEdit(row)"></vxe-button> <vxe-button type="text" @click="TabsEdit(row)"></vxe-button>
@ -216,12 +217,12 @@ const columns = [
width: '80', width: '80',
dataIndex: 'addrEN' dataIndex: 'addrEN'
}, },
{ // {
title: '属性字符串', // title: '',
align: 'center', // align: 'center',
width: '100', // width: '100',
dataIndex: 'propString' // dataIndex: 'propString'
}, // },
{ {
title: '发票抬头', title: '发票抬头',
align: 'center', align: 'center',
@ -303,6 +304,20 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
FnRpropString(data) {
let propString = ''
if (data.propString) {
data.propString.split(']').forEach(item => {
if (item.split('[')[1]) {
propString == ''
? (propString = `${item.split('[')[1]}`)
: (propString = `${propString},${item.split('[')[1]}`)
}
})
console.log(propString)
}
return propString
},
cellDBLClickEvent({ row }) { cellDBLClickEvent({ row }) {
this.TabsEdit(row) this.TabsEdit(row)
}, },

@ -25,24 +25,61 @@
@cell-dblclick="cellDBLClickEvent" @cell-dblclick="cellDBLClickEvent"
> >
<vxe-column type="seq" width="60"></vxe-column> <vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="name" title="Name"></vxe-column> <vxe-column field="itemCode" title="租户参数"></vxe-column>
<vxe-column field="sex" title="Sex" :formatter="formatterSex"></vxe-column> <!-- <vxe-column field="sex" title="Sex" :formatter="formatterSex"></vxe-column> -->
<vxe-column field="age" title="Age"></vxe-column> <vxe-column field="remark" title="备注"></vxe-column>
<vxe-column field="address" title="Address" show-overflow></vxe-column> <vxe-column title="操作" width="120" show-overflow>
<vxe-column title="操作" width="100" show-overflow>
<template #default="{ row }"> <template #default="{ row }">
<vxe-button type="text" icon="vxe-icon-edit" @click="editEvent(row)"></vxe-button> <vxe-button type="text" icon="vxe-icon-edit" @click="editEvent(row)"></vxe-button>
<vxe-button type="text" icon="vxe-icon-delete" @click="removeEvent(row)"></vxe-button> <vxe-button type="text" icon="vxe-icon-delete" @click="removeEvent(row)"></vxe-button>
</template> </template>
</vxe-column> </vxe-column>
</vxe-table> </vxe-table>
<vxe-modal
v-model="showEdit"
:title="selectRow ? '编辑&保存' : '新增&保存'"
width="800"
min-width="600"
min-height="300"
:loading="submitLoading"
resize
destroy-on-close
>
<template #default>
<vxe-form :data="formData" :rules="formRules" title-align="right" title-width="100" @submit="submitEvent">
<vxe-form-item field="itemCode" title="租户参数" :span="12" :item-render="{}">
<template #default="{ data }">
<vxe-input v-model="data.itemCode" placeholder="请输入租户参数"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item field="remark" title="备注" :span="12" :item-render="{}">
<template #default="{ data }">
<vxe-input v-model="data.remark" placeholder="请输入备注"></vxe-input>
</template>
</vxe-form-item>
<vxe-form-item align="center" title-align="left" :span="24">
<template #default>
<vxe-button type="submit">提交</vxe-button>
<vxe-button type="reset">重置</vxe-button>
</template>
</vxe-form-item>
</vxe-form>
</template>
</vxe-modal>
</a-spin> </a-spin>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import { DJYTenantParamGetParamItem, DJYTenantParamEdit } from '@/api/modular/main/DJYTenantParam' import {
DJYTenantParamGetParamItem,
DJYTenantParamAddParamItem,
DJYTenantParamEditParamItem,
DJYTenantParamDeleteParamItem,
DJYTenantParamEdit
} from '@/api/modular/main/DJYTenantParam'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage' import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
import VXETable from 'vxe-table'
export default { export default {
data() { data() {
return { return {
@ -68,7 +105,20 @@ export default {
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
data: {}, data: {},
tableData: [] tableData: [],
showEdit: false,
submitLoading: false,
selectRow: null,
formRules: {
name: [
{ required: true, message: '请输入名称' },
{ min: 3, max: 5, message: '长度在 3 到 5 个字符' }
],
nickname: [{ required: true, message: '请输入昵称' }],
sex: [{ required: true, message: '请选择性别' }]
},
RecordData: {},
formData: {}
} }
}, },
mounted() { mounted() {
@ -78,14 +128,56 @@ export default {
// }) // })
}, },
methods: { methods: {
async insertEvent(row) { submitEvent() {
this.submitLoading = true
if (this.selectRow) {
DJYTenantParamEditParamItem({ paraCode: this.RecordData.paraCode, ...this.formData }).then(res => {
console.log(res)
const $table = this.$refs.xTable const $table = this.$refs.xTable
const record = { this.submitLoading = false
this.showEdit = false
VXETable.modal.message({ content: '保存成功', status: 'success' })
Object.assign(this.selectRow, this.formData)
})
} else {
DJYTenantParamAddParamItem({ paraCode: this.RecordData.paraCode, ...this.formData }).then(res => {
console.log(res)
const $table = this.$refs.xTable
this.submitLoading = false
this.showEdit = false
VXETable.modal.message({ content: '新增成功', status: 'success' })
$table.insert(this.formData)
})
}
},
cellDBLClickEvent({ row }) {
this.editEvent(row)
},
editEvent(row) {
this.formData = { ...row }
this.selectRow = row
this.showEdit = true
},
async removeEvent(row) {
const type = await VXETable.modal.confirm('您确定要删除该数据?')
const $table = this.$refs.xTable
if (type === 'confirm') {
console.log(row)
DJYTenantParamDeleteParamItem({ id: row.id }).then(() => {
$table.remove(row)
VXETable.modal.message({ content: '删除成功', status: 'success' })
})
}
},
insertEvent() {
this.formData = {
paraCode: this.RecordData.paraCode,
itemCode: '',
itemName: '', itemName: '',
remark: '' remark: ''
} }
const { row: newRow } = await $table.insertAt(record, row) this.selectRow = null
await $table.setActiveCell(newRow, 'name') this.showEdit = true
}, },
editRowEvent(row) { editRowEvent(row) {
const $table = this.$refs.xTable const $table = this.$refs.xTable
@ -110,22 +202,13 @@ export default {
}, },
// //
edit(record) { edit(record) {
this.data = record this.RecordData = record
console.log(record) console.log(this.RecordData)
// console.log(record)
DJYTenantParamGetParamItem({ paraCode: record.paraCode }).then(res => { DJYTenantParamGetParamItem({ paraCode: record.paraCode }).then(res => {
this.tableData = res.data this.tableData = res.data
}) })
this.visible = true this.visible = true
// const typeOption = this.$options
// this.typeData = typeOption.filters['dictData']('edi_type')
// setTimeout(() => {
// this.form.setFieldsValue({
// paraName: record.paraName,
// paraCode: record.paraCode,
// remark: record.remark
// })
// console.log(this.form.getFieldsValue())
// }, 100)
}, },
handleSubmit() { handleSubmit() {
const { const {

@ -11,11 +11,15 @@
<a-form :form="form"> <a-form :form="form">
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="EDI类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="EDI类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-select
placeholder="请输入EDI类型名称" placeholder="请选择EDI类型"
v-decorator="['ediname', { rules: [{ required: true, message: '请输入EDI类型名称' }] }]" v-decorator="['edicode', { rules: [{ required: true, message: '请输入EDI类型' }] }]"
/> >
<a-select-option v-for="item in EdiNameData" :key="item.id" :value="item.code">{{
item.value
}}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -156,7 +160,7 @@
<script> <script>
import { DjyEdiSettingAdd } from '@/api/modular/main/EDIParameterSettingService' import { DjyEdiSettingAdd } from '@/api/modular/main/EDIParameterSettingService'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default { export default {
data() { data() {
return { return {
@ -171,9 +175,15 @@ export default {
typeData: [], typeData: [],
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this) form: this.$form.createForm(this),
EdiNameData: []
} }
}, },
mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346564507062341' }).then(res => {
this.EdiNameData = res.data.rows
})
},
methods: { methods: {
// //
add(record) { add(record) {

@ -11,11 +11,15 @@
<a-form :form="form"> <a-form :form="form">
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="EDI类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="EDI类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input <a-select
placeholder="请输入EDI类型名称" placeholder="请选择EDI类型"
v-decorator="['ediname', { rules: [{ required: true, message: '请输入EDI类型名称' }] }]" v-decorator="['edicode', { rules: [{ required: true, message: '请输入EDI类型' }] }]"
/> >
<a-select-option v-for="item in EdiNameData" :key="item.id" :value="item.code">{{
item.value
}}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -156,6 +160,7 @@
<script> <script>
import { DjyEdiSettingEdit } from '@/api/modular/main/EDIParameterSettingService' import { DjyEdiSettingEdit } from '@/api/modular/main/EDIParameterSettingService'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default { export default {
data() { data() {
return { return {
@ -170,19 +175,26 @@ export default {
typeData: [], typeData: [],
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this) form: this.$form.createForm(this),
EdiNameData: [],
data: {}
} }
}, },
mounted() {
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346564507062341' }).then(res => {
this.EdiNameData = res.data.rows
})
},
methods: { methods: {
// //
edit(record) { edit(record) {
console.log(record) this.data = record
this.visible = true this.visible = true
const typeOption = this.$options const typeOption = this.$options
this.typeData = typeOption.filters['dictData']('edi_type') this.typeData = typeOption.filters['dictData']('edi_type')
setTimeout(() => { setTimeout(() => {
this.form.setFieldsValue({ this.form.setFieldsValue({
ediname: record.ediname, edicode: record.edicode,
serverip: record.serverip, serverip: record.serverip,
foldername: record.foldername, foldername: record.foldername,
username: record.username, username: record.username,
@ -216,8 +228,9 @@ export default {
values[key] = JSON.stringify(values[key]) values[key] = JSON.stringify(values[key])
} }
} }
console.log(this.form, values.id) // console.log(this.form, values.id)
DjyEdiSettingEdit(values) let data = { ...values, id: this.data.id }
DjyEdiSettingEdit(data)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('编辑成功') this.$message.success('编辑成功')

@ -48,7 +48,11 @@
:min-width="item.width" :min-width="item.width"
:title="item.title" :title="item.title"
:align="item.align" :align="item.align"
></vxe-column> >
<template #default="{ row }" v-if="item.title == 'EDI类型'">
<span>{{ FnREdiName(row.edicode) }}</span>
</template>
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center"> <vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }"> <template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button> <vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
@ -83,6 +87,7 @@
</template> </template>
<script> <script>
import { DjyEdiSettingPage, DjyEdiSettingDelete } from '@/api/modular/main/EDIParameterSettingService' import { DjyEdiSettingPage, DjyEdiSettingDelete } from '@/api/modular/main/EDIParameterSettingService'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
import addForm from './addForm.vue' import addForm from './addForm.vue'
import editForm from './editForm.vue' import editForm from './editForm.vue'
import columnSetting from '@/components/tableColumnSetting' import columnSetting from '@/components/tableColumnSetting'
@ -107,10 +112,10 @@ export default {
ColumnsQuery: [], ColumnsQuery: [],
columns: [ columns: [
{ {
title: 'EDI类型名称', title: 'EDI类型',
align: 'center', align: 'center',
width: '100', width: '100',
dataIndex: 'ediname' dataIndex: 'edicode'
}, },
{ {
title: '服务器IP', title: '服务器IP',
@ -205,14 +210,27 @@ export default {
], ],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
// Promise // Promise
loadData: {} loadData: {},
EdiNameData: []
} }
}, },
created() {}, created() {},
mounted() { mounted() {
this.init() this.init()
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346564507062341' }).then(res => {
this.EdiNameData = res.data.rows
})
}, },
methods: { methods: {
FnREdiName(code) {
let data = ''
this.EdiNameData.forEach(item => {
if (item.code == code) {
data = `${item.value}`
}
})
return data
},
toggleAdvanced() { toggleAdvanced() {
this.advanced = !this.advanced this.advanced = !this.advanced
}, },

@ -14,7 +14,7 @@
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<!-- <a-input <!-- <a-input
placeholder="请选择类型" placeholder="请选择类型"
v-decorator="['typeCode', { rules: [{ required: true, message: '请输入EDI类型名称' }] }]" v-decorator="['typeCode', { rules: [{ required: true, message: '请输入EDI类型' }] }]"
/> --> /> -->
<a-select <a-select
placeholder="请选择类型" placeholder="请选择类型"

Loading…
Cancel
Save