lilu 2 years ago
commit 4dccba6f7c

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

@ -111,17 +111,15 @@
</a-form-item>
</a-col>
<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
mode="multiple"
placeholder="请选择属性字符串"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择属性字符串' }] }]"
placeholder="请选择客户属性"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择客户属性!' }] }]"
>
<a-select-option value="委托单位">委托单位</a-select-option>
<a-select-option value="车队">车队</a-select-option>
<a-select-option value="报关行">报关行</a-select-option>
<a-select-option value="订舱管理">订舱管理</a-select-option>
<a-select-option value="代理">代理</a-select-option>
<a-select-option v-for="item in propStringData" :key="item.id" :value="item.code">{{
item.value
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
@ -306,19 +304,38 @@ export default {
form: this.$form.createForm(this),
ContactsData: [],
Data: {},
TypeData: []
TypeData: [],
propStringData: []
}
},
mounted() {
DjyCustomerDetail({ id: this.RowData.id }).then(res => {
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({
...res.data
...res.data,
WpropString
})
})
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => {
this.TypeData = res.data.rows
})
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346100897906757' }).then(res => {
this.propStringData = res.data.rows
})
},
methods: {
removeCheckboxRow() {
@ -387,7 +404,14 @@ export default {
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 => {
if (res.success) {
this.$message.success('编辑成功')

@ -88,7 +88,8 @@
:title="item.title"
:align="item.align"
v-if="item.checked"
></vxe-column>
>
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="TabsEdit(row)"></vxe-button>
@ -216,12 +217,12 @@ const columns = [
width: '80',
dataIndex: 'addrEN'
},
{
title: '属性字符串',
align: 'center',
width: '100',
dataIndex: 'propString'
},
// {
// title: '',
// align: 'center',
// width: '100',
// dataIndex: 'propString'
// },
{
title: '发票抬头',
align: 'center',
@ -303,6 +304,20 @@ export default {
this.init()
},
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 }) {
this.TabsEdit(row)
},

@ -25,24 +25,61 @@
@cell-dblclick="cellDBLClickEvent"
>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="name" title="Name"></vxe-column>
<vxe-column field="sex" title="Sex" :formatter="formatterSex"></vxe-column>
<vxe-column field="age" title="Age"></vxe-column>
<vxe-column field="address" title="Address" show-overflow></vxe-column>
<vxe-column title="操作" width="100" show-overflow>
<vxe-column field="itemCode" title="租户参数"></vxe-column>
<!-- <vxe-column field="sex" title="Sex" :formatter="formatterSex"></vxe-column> -->
<vxe-column field="remark" title="备注"></vxe-column>
<vxe-column title="操作" width="120" show-overflow>
<template #default="{ row }">
<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>
</template>
</vxe-column>
</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-modal>
</template>
<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 VXETable from 'vxe-table'
export default {
data() {
return {
@ -68,7 +105,20 @@ export default {
confirmLoading: false,
form: this.$form.createForm(this),
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() {
@ -78,14 +128,56 @@ export default {
// })
},
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
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
const record = {
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: '',
remark: ''
}
const { row: newRow } = await $table.insertAt(record, row)
await $table.setActiveCell(newRow, 'name')
this.selectRow = null
this.showEdit = true
},
editRowEvent(row) {
const $table = this.$refs.xTable
@ -110,22 +202,13 @@ export default {
},
//
edit(record) {
this.data = record
console.log(record)
this.RecordData = record
console.log(this.RecordData)
// console.log(record)
DJYTenantParamGetParamItem({ paraCode: record.paraCode }).then(res => {
this.tableData = res.data
})
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() {
const {

@ -11,11 +11,15 @@
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="EDI类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入EDI类型名称"
v-decorator="['ediname', { rules: [{ required: true, message: '请输入EDI类型名称' }] }]"
/>
<a-form-item label="EDI类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
placeholder="请选择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-col>
<a-col :span="8">
@ -156,7 +160,7 @@
<script>
import { DjyEdiSettingAdd } from '@/api/modular/main/EDIParameterSettingService'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default {
data() {
return {
@ -171,9 +175,15 @@ export default {
typeData: [],
visible: 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: {
//
add(record) {

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

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

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

Loading…
Cancel
Save